You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by enalposi <en...@yahoo.com> on 2011/03/03 16:46:29 UTC

How to stop an Exchange in a Processor

We are extending DelegateProcessor to fiddle with the payload before it hits
the business logic.

How do we correctly stop an Exchange that we want to drop?
Would it be this or is there a more straight forward method?

myExchange.getContext().getInFlightRepository().remove(myExchange)

Thanks!



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-an-Exchange-in-a-Processor-tp3408126p3408126.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to stop an Exchange in a Processor

Posted by enalposi <en...@yahoo.com>.
Ok, so I'll use:

029        public void process(Exchange exchange) throws Exception {
030            // mark the exchange to stop continue routing
031            exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);
032        }

Thanks for the quick response! :)

--
View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-an-Exchange-in-a-Processor-tp3408126p3408162.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to stop an Exchange in a Processor

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the StopProcessor. You can set a property on the exchange, to tell
it to stop continue routing the exchange.


On Thu, Mar 3, 2011 at 4:46 PM, enalposi <en...@yahoo.com> wrote:
> We are extending DelegateProcessor to fiddle with the payload before it hits
> the business logic.
>
> How do we correctly stop an Exchange that we want to drop?
> Would it be this or is there a more straight forward method?
>
> myExchange.getContext().getInFlightRepository().remove(myExchange)
>
> Thanks!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-an-Exchange-in-a-Processor-tp3408126p3408126.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/