camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wolf <>
Subject Re: ErrorHandler + DeadLetter
Date Thu, 02 Oct 2008 09:57:13 GMT
Hash: SHA1

Hi Claus,

thanks for you help.
But no it does not work. The source endpoint is a jms queue and if I put
it back to that queue, then the processing starts again and result in an
endless loop.
What we require is an error handling where configured exceptions should
be set as fault or exception onto the out message and returned to the
sender (the process that initiated the jms message and which is waiting
for a response).

Any other idea?

> Hi
> Yes I think you can using the ExceptionPolicyStrategy (se overriding default behaviour)
> You can either implement the logic in your own class (for really advanced stuff, or you
need to be 100% in control what to do), or use the default behavior, that will look for the
best matching exception route or fallback to the default error endpoint configured on the
> The matching will look for: exception(TheExceptionClass.class) where you can customize
the behaviour, e.g. setting a different retry and where to route it in case of redelivery
> exception(MyPolicyException.class)
>         .maximumRedeliveries(1)
>         .setHeader(MESSAGE_INFO, constant("Damm my policy exception"))
>         .to(ERROR_QUEUE);
> Notice that we will change exception to onException in Camel 1.5 as this is a better
name for the DSL. It is in fact named onException in the Spring DSL.
> So in your case you can do like this:
> exception(MySpecialException.class)
>         .maximumRedeliveries(0)
>         .to("the endpoint URL that started it");
> So when a MySpecialException is thrown its caught by the above configuration and routed
to the ""the endpoint URL that started it". All other exceptions is handled by the default
> We might need to clean up the wiki and add some better samples for this.
> Could you try it and report back if it worked. Then we could use your use-case as a sample
to add to the wiki
> Med venlig hilsen
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web:
> -----Original Message-----
> From: Markus Wolf [] 
> Sent: 2. oktober 2008 11:23
> To:
> Subject: ErrorHandler + DeadLetter
> Hi,
> is it possible to create a route where some exceptions are handled by
> the deadletter queue and some other just returned to the starting endpoint?
> I've only found examples where all errors are handed over to the
> deadletter endpoint.
> Thanks for any help
> Markus Wolf

- --
NMMN - New Media Markets & Networks GmbH
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona UStID DE 812 699 852  HRB 71102 Hamburg
HypoVereinsbank  -   BLZ 200 300 00  -  Konto-Nr. 156 29 82               Tel.: +49 40 284 118 -0
Langbehnstrasse 6                 Entwicklung:         -720
22761 Hamburg                     Fax:                 -999

Rufen Sie uns kostenlos an:

+++ Hausmesse am 14.11.2008 von 10:00 bis 16:00 Uhr +++
Überzeugen Sie sich auf unserer Hausmesse von unseren Produkten und
Dienstleistungen! Weitere Informationen und Anmeldung unter:
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


View raw message