camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: ErrorHandler + DeadLetter
Date Thu, 02 Oct 2008 09:39:43 GMT

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 DeadLetterChannel.

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 failures.

        .setHeader(MESSAGE_INFO, constant("Damm my policy exception"))

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:

        .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 DeadLetterChannel.

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
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: Markus Wolf [] 
Sent: 2. oktober 2008 11:23
Subject: ErrorHandler + DeadLetter

Hash: SHA1


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