You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christopher Gardner <ch...@gmail.com> on 2013/09/04 18:34:39 UTC

StopOnException and Conditional Wiretapping

I have a splitter/streaming route that sends chunks of data to a downstream
route.  It has a bean that processes the split data and uses a
ProducerTemplate to send that processed split data.  If the downstream
route has a problem, I'd like to stop the splitting process.  I understand
that if an exception is raised on the downstream route, the only way for my
splitter route bean will know is to check the returned exchange for an
exception or some indicator that an exception occurred on that downstream
route.

Here's what I'd like to do, if possible:

1. Halt streaming when a problem occurs in the downstream route.  My
splitter route can be configured with stopOnException.  The bean that uses
the ProducerTemplate can check the Exchange for an error and throw its own
exception, stopping the split.

2.  If the bean that uses the ProducerTemplate has its own problems
processing data (before it calls the ProducerTemplate), I'd like to stop
the route.  That bean can throw an exception in this situation, stopping
the split.  The difference here is I'd like to wiretap to one route if the
bean has no problems processing (before it hits the ProducerTemplate) and
wiretap to another if the bean does have problems.

Any thoughts on how to do something like that?