Claus Ibsen-2 wrote:
> 
> Sort of. I am about to leave the office, but you have a very
> interesting use-case that I need to dig into. If time permits I will
> be online tonight.
> 
> You can define your own exception policy strategy:
> http://activemq.apache.org/camel/error-handler.html
> 
> That is the policy to determine which onException should be triggered.
> 
> But to get it clear.
> If your bean myOwnErrorHandler throws an exception what do you want to
> happen?
> If myOwnErrorHandler throws an exception, I want the same thing to happen
> as with any other exception than FunctionalException. For my use case,
> that means a certain number of redeliveries and a certain delay time, and
> is defined by the redeliveryPolicyConfig bean.

But I've now chosen to solve this by using an extra queue. So in case of a
FunctionalException, instead of routing the message to myOwnErrorHandler,
I'll route the message to myOwnErrorQueue. And I'll set up a new route that
listens to myOwnErrorQueue, which will route any message from that queue to
myOwnErrorHandler. That way, any exceptions thrown by myOwnErrorHandler will
be handled by the same policy that's set up for the
ActiveMQConnectionFactory. How does that sound to you?

Still, I have these to issues to resolve:
1. The onException part seems to be triggered, even if the Exception is not
a FunctionalException. I'm curious about if that's a bug, or if there's
something wrong with my configuration.
2. The onException should ideally not just check the exception type, but
also an Enum within the exception, indicating an error code, before deciding
if it needs "special treatment". As far as I can tell, that's not supported
by the Camel XML.
-- 
View this message in context: 
http://www.nabble.com/1.5-error-handling-Spring-config-buggy-not-complete--tp20562554s22882p20582041.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to