You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by shindito <at...@gmail.com> on 2013/03/28 23:18:19 UTC

Change ErrorHandlerFactory of a route runtime

Hello,

is Camel capable of the following:
I have a CamelContext with several routes defined and running. I have
specified an ErrorHandlerFactory in the CamelContext (e.g. a
DefautlErrorHandlerBuilder with maximumRedeliveries, redeliveryProcessor,
and redeliverDelay properties defined) so that all routes created from this
context inherit the ErrorHandlerFactory (DefaultErrorHandlerBuilder). 
Now, I want to update all running routes with a DeadLetterChannel error
handler (remove the default one!). How is this achievable?
I've tried the following:
1. Stop context -> context.setErrorHandlerBuilder(dlc) -> context.start()
2. Stop all routes -> for each route setErrorHandlerBuilder(dlc) -> start
all routes
3. Stop context -> stop all routes -> context.setErrorHandlerBuilder(dlc) ->
for each route setErrorHandlerBuilder(dlc) -> start routes and context

In all cases the old error handler is still active and gets activated if an
error occurs. I've debugged the routes (in case 2. and 4. for example) and
they are successfully updated with the dlc, however, the old handler is
still active and the dlc is not used at all in case of a failure.

Any ideas how to update the error handler runtime?

Thanks for your help and advices!!!

Best regards,
Atanas



--
View this message in context: http://camel.465427.n5.nabble.com/Change-ErrorHandlerFactory-of-a-route-runtime-tp5730057.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Change ErrorHandlerFactory of a route runtime

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I would stop and remove the routes. And then add them back again. Then
they are re-created and the new error handler should take affect.

Btw you can adjust the running error handlers from JMX also. So you
can adjust number of redeliveries etc.


On Thu, Mar 28, 2013 at 11:18 PM, shindito <at...@gmail.com> wrote:
> Hello,
>
> is Camel capable of the following:
> I have a CamelContext with several routes defined and running. I have
> specified an ErrorHandlerFactory in the CamelContext (e.g. a
> DefautlErrorHandlerBuilder with maximumRedeliveries, redeliveryProcessor,
> and redeliverDelay properties defined) so that all routes created from this
> context inherit the ErrorHandlerFactory (DefaultErrorHandlerBuilder).
> Now, I want to update all running routes with a DeadLetterChannel error
> handler (remove the default one!). How is this achievable?
> I've tried the following:
> 1. Stop context -> context.setErrorHandlerBuilder(dlc) -> context.start()
> 2. Stop all routes -> for each route setErrorHandlerBuilder(dlc) -> start
> all routes
> 3. Stop context -> stop all routes -> context.setErrorHandlerBuilder(dlc) ->
> for each route setErrorHandlerBuilder(dlc) -> start routes and context
>
> In all cases the old error handler is still active and gets activated if an
> error occurs. I've debugged the routes (in case 2. and 4. for example) and
> they are successfully updated with the dlc, however, the old handler is
> still active and the dlc is not used at all in case of a failure.
>
> Any ideas how to update the error handler runtime?
>
> Thanks for your help and advices!!!
>
> Best regards,
> Atanas
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Change-ErrorHandlerFactory-of-a-route-runtime-tp5730057.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: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Change ErrorHandlerFactory of a route runtime

Posted by shindito <at...@gmail.com>.
Hi Claus,

Thanks for the quick answer. I'll give it a try with the JMX proposal . . .

Regards,
Atanas



--
View this message in context: http://camel.465427.n5.nabble.com/Change-ErrorHandlerFactory-of-a-route-runtime-tp5730057p5730072.html
Sent from the Camel - Users mailing list archive at Nabble.com.