Hi
Do like this
from("direct:start")
.choice()
.when(property("falseproperty").isEqualTo(true))
.to("direct:falseproperty")
.otherwise()
.wireTap("direct:wiretapp")
.newExchangeBody(constant("in wiretap"))
.endChoice()
.setBody(constant("after wiretapping"))
.to("log:end")
.end();
On Thu, May 8, 2014 at 10:49 AM, a746076drdrb <[email protected]> wrote:
> Hello,
>
> I'm getting Exception:
>
> in thread "main" org.apache.camel.RuntimeCamelException:
> java.lang.ClassCastException: org.apache.camel.model.OtherwiseDefinition
> cannot be cast to org.apache.camel.model.ChoiceDefinition
>
> when using wireTap in otherwise(). I've tried to use end() and endChoice()
> but it doesn't help. Is it possible to use wiretap definition in otherwise
> clause?
>
>
>
> from("timer://foo?fixedRate=true&period=3s")
> .choice()
> .when(property("falseproperty").isEqualTo(true))
> .to("direct:falseproperty")
> .otherwise()
> .wireTap("direct:wiretapp")
> .newExchangeBody(constant("in wiretap"))
> .end()
> .setBody(constant("after wiretapping"))
> .to("log:end")
> .endChoice();
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/wiretap-in-otherwise-does-not-work-tp5750955.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/