How can I stop a route from a routePage edited by Claus IbsenChanges (1)
Full ContentHow can I stop a route from a routeThe CamelContext provides API for managing routes at runtime. It has a stopRoute(id) and startRoute(id) methods. Stopping a route during routing an existing message is a bit tricky. The reason for that is Camel will Graceful Shutdown the route you are stopping. And if you do that while a message is being routed the Graceful Shutdown will try to wait until that message has been processed. from("direct:start") .to("bean:foo?method=doSomething").routeId("myCoolRoute") .process(new Processor() { public void process(Exchange exchange) throws Exception { // remove myself from the in flight registry so we can stop this route without trouble context.getInflightRepository().remove(exchange); // stop this route context.stopRoute("myCoolRoute"); });
See more details about the Lifecycle. See Also
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Camel > How can I stop a route from a route confluence