You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wang Yan <wy...@gmail.com> on 2019/03/06 13:16:37 UTC

DeadLetterChannel handle option

Hello All,

based on below document
if handle =false the message will be propagated to caller when exception
happened
if handle=true, the message will not be propagated to caller but somewhere
else as you can
define . is my understanding correct?

http://camel.apache.org/dead-letter-channel.html
The *DeadLetterChannel* lets you control behaviors including redelivery,
whether to propagate the thrown Exception to the caller (the *handled* option),
and where the (failed) Exchange should now be routed to.

RE: DeadLetterChannel handle option

Posted by Valdis Andersons <va...@vhi.ie>.
Hey,

That's pretty much how I would understand it was well. Though I'm not setting the handled option explicitly anywhere in my route builders. To make the exchange go somewhere else in case of an exception you'd really just have to specify the deadLetterChannel in the errorHandler of your route builder:

errorHandler(deadLetterChannel(deadLetterQueue));

Optionally you can also define a retry strategy on some exceptions while not on others:

onException(RecoverableException.class)
					.maximumRedeliveries(redeliverable.maximumRedeliveries())
					.redeliveryDelay(redeliverable.redeliveryDelay())
					.logExhaustedMessageHistory(true)
					.retryAttemptedLogLevel(LoggingLevel.WARN)
					.useOriginalMessage();

Or whatever fits your use case and requirements.

To get the log output for an exception that isn't specified for the retry (in the onException configuration) I had to configure my logging properties this way:

logging:
    level:
        org:
            apache:
                camel: ERROR
                processor:
                    DeadLetterChannel: DEBUG

That will print a line in the logs every time something gets dead-lettered due to an exception that hasn't been handled in the code.


Cheers,
Valdis

-----Original Message-----
From: Wang Yan [mailto:wyanbox@gmail.com] 
Sent: 06 March 2019 13:17
To: users@camel.apache.org
Subject: DeadLetterChannel handle option

Hello All,

based on below document
if handle =false the message will be propagated to caller when exception happened if handle=true, the message will not be propagated to caller but somewhere else as you can define . is my understanding correct?

http://scanmail.trustwave.com/?c=6600&d=2sj_3M0KVwaA2voGn_01oHSf2lEMV672cpA88z2Sww&s=33&u=http%3a%2f%2fcamel%2eapache%2eorg%2fdead-letter-channel%2ehtml
The *DeadLetterChannel* lets you control behaviors including redelivery, whether to propagate the thrown Exception to the caller (the *handled* option), and where the (failed) Exchange should now be routed to.

Vhi Group DAC (Vhi) is a holding company for insurance and healthcare services, which include Vhi Healthcare DAC, Vhi Insurance DAC, Vhi Health Services DAC and Vhi Investments DAC. Vhi Healthcare DAC trading as Vhi Healthcare and Vhi Insurance DAC trading as Vhi Insurance are regulated by the Central Bank of Ireland. Vhi Healthcare is tied to Vhi Insurance DAC for health insurance in Ireland which is underwritten by Vhi Insurance DAC. Vhi Healthcare is tied to Zurich Life Assurance plc for Vhi Life Term Insurance and Vhi Mortgage Protection which is underwritten by Zurich Life Assurance plc. Vhi Healthcare is tied to Collinson Insurance Services Limited for MultiTrip Travel Insurance, Backpacker Travel Insurance and Vhi Dental Insurance which are underwritten by Great Lakes Insurance SE, UK branch and for Vhi Canada Cover and Vhi International Health Insurance which are underwritten by Astrenska Insurance Limited. For more information about the Vhi Group please go to: https://www.vhi.ie/about-vhi. 


Tá Vhi Group DAC (Vhi) ina chuideachta sealbhaíochta le haghaidh seirbhísí árachais agus seirbhísí cúram sláinte, lena n-áirítear Vhi Healthcare DAC, Vhi Insurance DAC, Vhi Health Services DAC agus Vhi Investments DAC. Déanann Banc Ceannais na hÉireann rialáil ar Vhi Healthcare DAC, ag trádáil dó mar Vhi Healthcare, agus ar Vhi Insurance DAC, ag trádáil dó mar Vhi Insurance. Tá Vhi Healthcare ceangailte le Vhi Insurance DAC le haghaidh árachas sláinte in Éirinn, rud atá frithgheallta ag Vhi Insurance DAC. Tá Vhi Healthcare ceangailte le Zurich Life Assurance plc le haghaidh Árachais Saoil de chuid Vhi agus Árachas Cosanta Morgáiste de chuid Vhi atá frithgheallta ag Zurich Life Assurance plc. Tá Vhi Healthcare ceangailte le Collinson Insurance Services Limited le haghaidh Árachas Taistil Ilturais agus Turasóirí Mála Droma agus Árachas Fiaclóireachta de chuid Vhi atá frithgheallta ag Great Lakes Insurance SE, UK branch agus le haghaidh Clúdach Cheanada de chuid Vhi agus Árachas Sláinte Idirnáisiúnta de chuid Vhi atá frithgheallta ag Astrenska Insurance Limited. Chun tuilleadh faisnéise a fháil faoi Ghrúpa Vhi, tabhair cuairt ar: https://www.vhi.ie/about-vhi. 

This e-mail and any files transmitted with it contain information which may be confidential and which may also be privileged and is intended solely for the use of the individual or entity to whom it is addressed. Unless you are the intended recipient you may not copy or use it, or disclose it to anyone else. Any opinions expressed are that of the individual and not necessarily that of the Vhi Group. If you have received this e-mail in error please notify the sender by return.