How to stop the processing of the Camel route if one of Multicast destination fails?
Environment
- JBoss Fuse 6.1
Issue
- I found that the messages don't make it to the two other routes when the first destination fails.
- how to tell the Camel to stop the processing of the messages if the delivery to the first of the destination fails?
Resolution
In order to stop processing of the message after the first failure of the Multicast delivery, use stopOnException option, just as demonstrated on the snippet below.
from("direct:test").
multicast.stopOnException().to("jms:sales", "jms:audit", "jms:accounting");
Root Cause
- Camel multicast is used to send the copy of the message to the three endpoints:
from("direct:test").
multicast.to("jms:sales", "jms:audit", "jms:accounting");
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
