I apologize if this is a simple question - but I just need to be sure! I am developing this route that handles multiple message types and uses a "when()" predicate to send the message to the appropriate processor based on a header value. In the "Otherwise" case I want to send it to an unknown format processor to log the error but I don't want the exchange to continue from there (as there is further processing that needs to only occur on a valid message).
Here is the route: from("direct:incoming") .choice() .when(header("status").isEqualTo("1")) .process(status1processor) .when(header("status").isEqualTo("2)) .process(status2processor) .otherwise().process(unknownstatusprocessor) .end() .process(someOtherProcessor) .to("mock:outgoing); Now - I thought of just putting: .otherwise().process(unknownstatusprocessor).to("mock:garbage") The main concern I have is that I want this "garbage" endpoint to be something we can use in our live environment. I am not sure if "mock" is wise. I thought of "direct:garbage" - but as I understand it - that is an "in memory queue" essentially. And I don't want it to ever fill up if exchanges just sit there unprocessed. I just want to make sure that whatever endpoint I use - it truly is a "garbage can". We just want to log the information and get rid of the message. Am I over thinking the behavior of "mock" and it will just be the black hole I am looking for? Thanks for the help! -- 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-tp25933807p25933807.html Sent from the Camel - Users mailing list archive at Nabble.com.