On Thu, Oct 25, 2012 at 4:06 PM, rajasekar <ext-rajasekar....@nokia.com> wrote:
> Hi ,
>
> Can you provide me some sample of camel context which uses suspend and
> resume route .
>
> I have requirement to suspend a route ( in a camel-context.xml ) when n
> number errors occurred calling a http endpoint and stop consuming messages
> from jms queue for x time and resume this route to start consuming messages
> from jms queue and send it to http endpoint.
>

See this page
http://camel.apache.org/routepolicy

You can then add logic in onExchangeDone and check for failure, and
then react accordingly.
To suspend/stop a route see the next FAQ

See this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

An alternative is to use an event notifier to listen on events, and
then react accordingly.
http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html

Then you can listen for exchanges failed, and coming from a given
route/endpoint as origin. To know it was from the route you want to
suspend if X number of errors etc.

There is API on CamelContext to control routes, to suspend/stop/start etc.



> Regards
> Raj
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Trigger-start-stop-resume-suspend-of-a-camel-route-using-queue-db-tp4343283p5721560.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to