I have a route that uses multicast parallel processing to process messages
in parallel. It works great, when everything is good. However if an
exception happens in any of the multicasted routes, the exception is
handled by the multicast but never written to the route's dead letter
channel. I am using the "shareUnitOfWork" and "stopOnException" but they
don't seem to help.

I discovered this while working on a unit test. Here is the unit test route:

from(errorMultiDirect).routeId("errorMulticastTest")
.errorHandler(deadLetterChannel(mock)
              .onPrepareFailure(errorProcessor).maximumRedeliveries(0))
.log(LoggingLevel.INFO, "Testing Error route")
.setHeader(OrderMessageConstants.WIMS_MSG_TYPE, simple("body[messageType]"))
.setHeader(OrderMessageConstants.SAP_MESSAGE_ID, simple("body[messageID]"))
.setHeader(OrderMessageConstants.ORDER_NUMBER,
simple("body[orderHeader][order]"))
.multicast().parallelProcessing().shareUnitOfWork().stopOnException().to("direct:materialsTest",
"direct:qmDocTest", "direct:sdsTest").end()
.to("log:com.sial.NotifyStatusLogger?level=INFO");

The test sends a message that causes "direct:materialsTest" to throw a null
pointer exception.

I can send the same message to this route which does not use multicast and
the error is propagated to the dead letter chanel.

from(errorDirect).routeId("errorMaterialTest")
.errorHandler(deadLetterChannel(mock)
              .onPrepareFailure(errorProcessor).maximumRedeliveries(0))
.log(LoggingLevel.INFO, "Testing Error route")
.setHeader(OrderMessageConstants.WIMS_MSG_TYPE, simple("body[messageType]"))
.setHeader(OrderMessageConstants.SAP_MESSAGE_ID, simple("body[messageID]"))
.setHeader(OrderMessageConstants.ORDER_NUMBER,
simple("body[orderHeader][order]"))
.bean(materialsEnrichment)
.to("log:com.sial.NotifyStatusLogger?level=INFO");

I am using Apache-camel 2.18.2
I will have to remove the multicast if it won't propagate the exception to
the Dead letter chanel

-- 


This message and any attachment are confidential and may be
privileged or 
otherwise protected from disclosure. If you are not the intended
recipient, 
you must not copy this message or attachment or disclose the
contents to 
any other person. If you have received this transmission in error,
please 
notify the sender immediately and delete the message and any attachment

from your system. Merck KGaA, Darmstadt, Germany and any of its 
subsidiaries do
not accept liability for any omissions or errors in this 
message which may
arise as a result of E-Mail-transmission or for damages 
resulting from any
unauthorized changes of the content of this message and 
any attachment thereto.
Merck KGaA, Darmstadt, Germany and any of its 
subsidiaries do not guarantee
that this message is free of viruses and does 
not accept liability for any
damages caused by any virus transmitted 
therewith.



Click http://www.emdgroup.com/disclaimer 
<http://www.emdgroup.com/disclaimer> to access the
German, French, Spanish 
and Portuguese versions of this disclaimer.

Reply via email to