You need the condition before the processor.
such as
interceptSendToEndpoint("mock:skippable").skipSendToOriginalEndpoint()
.when(body().isEqualTo("skip")).to("mock:detour");
On Fri, Apr 3, 2015 at 7:01 AM, Andrei Stoica
<[email protected]> wrote:
> Hello. It seems that conditional skipping when intercepting a message is not
> working anymore. My route is this:
>
> interceptSendToEndpoint("jms:variableQueue")
> .process(new Processor() {
>
> @Override
> public void process(Exchange exchange) throws
> Exception {
>
> // Code that puts a property on an echange
> }
> })
>
> .skipSendToOriginalEndpoint().when(constant(false).isEqualTo(true));
>
> This condition is put for testing means to check if the code forwards the
> message. The above code should always forward the exchange but actual it
> doesn't.
>
> My actual skip condition is this:
>
> .skipSendToOriginalEndpoint().when(exchangeProperty("skip").isEqualTo(true));
>
>
> Can someone confirm this?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Conditional-skipping-when-intercepting-message-tp5765255.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/