I need to enrich the /RedeliveryPolicy/ with custom attributes, so I have
subclassed it.
Then I subclassed /DefaultExceptionPolicyStrategy/ in order to properly map
custom /RedeliveryPolicy/ instances to exception types.
/DeadLetterChannelBuilder.onExceptionOccurred/ I need to get access to
/currentRedeliveryPolicy/ and its custom attributes, so I subclassed
/DeadLetterChannel/ in order to intercept the /RedeliveryData/ parameter of
/DeadLetterChannel.onExceptionOccurred/ method calls and save its
/currentRedeliveryPolicy/ into an exchange property.
So far it's UGLY.
But at this point I've seen that
/RedeliveryErrorHandler.RedeliveryData.currentRedeliveryPolicy/ has package
visibility, so I need to introduce a class with package
/org.apache.camel.processor/ just to access that field.
The problem is that this easily becomes a MESS when I try to run this in an
OSGi environment, cause it makes /org.apache.camel.processor/ a splitted
package.
Is there any better way to achieve the same?
davide_cavestro 's gravatar image asked Feb 17 2017 at 07:09 in Camel-Users by davide_cavestro

3 Answers

Hi
This is not intended for end users to do
Claus Ibsen
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Claus Ibsen 's gravatar image answered Feb 17 2017 at 07:35 by Claus Ibsen
@Claus could you please elaborate on it?
How can I react to exceptions, based on their types and some related
configuration defined for the whole context?
i.e. I need to enrich the original redelivery behavior with further attempts
(out-of-process)
Claus Ibsen-2 wrote
davide_cavestro 's gravatar image answered Feb 17 2017 at 07:44 by davide_cavestro
Study error handler some more it can do a lot.
And if you have Camel in Action 2nd ed book then read the chapter it
cover a lot about error handling and how it works.
Claus Ibsen
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Claus Ibsen 's gravatar image answered Feb 17 2017 at 07:51 by Claus Ibsen