camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanq <jqu...@abebooks.com>
Subject Re: Best way to throw away an exchange in a route in an otherwise() case
Date Sat, 17 Oct 2009 00:02:10 GMT

I think I found the solution in the documentation (that's what I get for
finally posting a question - never fails I will find the answer 10 minutes
later).

This is waht I have now:

from("direct:incoming")
            .choice()
              .when(header("status").isEqualTo("1"))
                .process(status1processor)
              .when(header("status").isEqualTo("2))
                .process(status2processor)
              .otherwise().process(unknownstatusprocessor).stop()
            .end()
            .process(someOtherProcessor)
            .to("mock:outgoing);

Specifically - I added the .stop() to the otherwise() path. 

.otherwise().process(getUnknownEmailStatusProcessor()).stop()

Is that the correct way to do it?  My unit tests seem to say so..but I
wanted to ask the experts to be sure.
-- 
View this message in context: http://www.nabble.com/Best-way-to-throw-away-an-exchange-in-a-route-in-an-otherwise%28%29-case-tp25933807p25933965.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message