i in process of developing message router , part of design stopping/suspending , starting/resuming routes based on file commands dropped in control route.
i tried follow camel recommendations favor suspend/resume route alternative stop/start it.
my resume logic depends of state of routes have 2 routes abc , xyz cannot active @ same time. facilitate control route supports 2 commands suspend <route id> , resume <route id>. in short resume xyz nothing if route abc not suspended.
my unit tests (using jmockit) passed ok. when running real application see route xyz never resumes if suspended route abc before.
i put log entries , surprise after executing route.suspend("abc") apparently giving camel log entries route abc still reports not suspended. code:
logger.info(r.getid() + " route supports suspension=" + r.supportssuspension()); context.suspendroute(r.getid()); logger.info("after suspending route " + r.getid() + " route suspended state " + ((servicesupport) r).issuspended()); and below log entries:
[info ] my.org.message.router.lifecycle.deactivatecommand - abc route supports suspension=true [info ] org.apache.camel.impl.defaultshutdownstrategy - starting graceful shutdown 1 routes (timeout 300 seconds) [info ] org.apache.camel.impl.defaultshutdownstrategy - route: abc suspend complete, consuming from: endpoint[abc://queue:some_queue] [info ] org.apache.camel.impl.defaultshutdownstrategy - graceful shutdown of 1 routes completed in 0 seconds [info ] org.apache.camel.spring.springcamelcontext - route: abc suspended, consuming from: endpoint[abc://queue:some_queue] [info ] my.org.message.router.lifecycle.deactivatecommand - after suspending route abc route suspended state false so questions are:
- is bug or doing wrong way
- if bug there work around or should go stop/start way
- if fault correct way of achieving after
thank in advance inputs
yeah bug in apache camel not report correct state - route suspended. have logged ticket: https://issues.apache.org/jira/browse/camel-8964
you can correct state using camelcontext.getroutestatus(routeid) api.
Comments
Post a Comment