You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sarfaraj <sa...@gmail.com> on 2012/07/03 10:59:42 UTC
Re: Camel 2.9.1 DeadLetterChannel infinite loop
Could you please paste the code here? what you did to resolved?
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-1-DeadLetterChannel-infinite-loop-tp5714961p5715399.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.9.1 DeadLetterChannel infinite loop
Posted by "E.Gherardini" <e....@hotmail.com>.
Hello sarfarj,
this is the doTry() doCatch() solution I've found. I remark that the
approach suggested by Claus (which is basically using the Recipient List EIP
to choose the dead letter queue at runtime) is much more cleaner.
@Override
public void configure() throws Exception {
from(INBOUND_QUEUE)
.threads(routeExecutionThreadCount)
.doTry()
.to(DEST_1, DEST_2)
.doCatch(Exception.class)
.process(new
CounterHeaderIncrementorProcessor(Constants.MY_REDELIVERIES_COUNTER_HEADER,
1))
.choice()
.when(header(Constants.MY_REDELIVERIES_COUNTER_HEADER).isLessThanOrEqualTo(redeliveriesCount))
// redeliver 'redeliveriesCount' times
.log(LoggingLevel.ERROR, exceptionMessage().toString())
.to(INBOUND_QUEUE).stop()
.otherwise()
.log(LoggingLevel.ERROR,"Message <${body}> sent to deadLetterQueue <"+
DEAD_LETTER_QUEUE + ">")
.to(DEAD_LETTER_QUEUE).stop()
.end()
.end()
;
}
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-1-DeadLetterChannel-infinite-loop-tp5714961p5715422.html
Sent from the Camel - Users mailing list archive at Nabble.com.