1 Reply Latest reply on Jun 17, 2013 9:02 PM by Keith Babo

    How can I suspend/stop Camel's route or consumer?

    Jan Bares Newbie



      in the case I detect exception when message is processed in Camel route, I would like to suspend/stop processing of queued messages. I followed http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html but it seems that the suspend/stop on route or consumer is not propagated from SY to Camel, route is not active but the Consumer is still consuming and I get RejectedExecutionException. The only working way is to call suspend/stop on CamelContext. Unfortunately this will suspend/stop all routes. I am using SY 0.8.


      Thank you, Jan

        • 1. Re: How can I suspend/stop Camel's route or consumer?
          Keith Babo Master

          There are multiple Camel routes in a SY application. If you have a Camel service binding, for example, that's a route.  If the Camel service binding routes into your camel routing service (i.e. a Camel implementation), then the implementation is a route as well.  You want to stop the gateway and not the route for the implementation if you want to stop the flow of messages into the service.  Rob has a monster commit coming up which adds plumbing, admin, JMX, and console support for starting/stopping gateway bindings.  I think this is the best way to achieve what you want in 1.0.  For 0.8, if you are using a Camel gateway binding you can always find the gateway route via the CamelContext (one per application) and stop it that way.