You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christopher Gardner <ch...@gmail.com> on 2013/08/28 21:26:28 UTC

Conditional Wiretapping

Is there a spring and/or Java DSL way to conditionally wiretap? Example
would be if a header has one value, I'd like to wiretap to "direct:a", if
it has another value to "direct:b".  The only thing I can think of now is
to wiretap to "direct:determineWhereToWiretap", which includes a processor
on the route to actually check such a header value and route accordingly.

Re: Conditional Wiretapping

Posted by Claus Ibsen <cl...@gmail.com>.
Yes the EIPs is very composable and I like to picture this as they are
like LEGO bricks and you can put them together any how you like and
construct new EIP patterns / solutions for your integration needs.

So using a filter / content based router with the wire tap can solve
this problem.

On Wed, Aug 28, 2013 at 10:24 PM, Christian Posta
<ch...@gmail.com> wrote:
> Maybe more like:
>
> from("direct:foo")
>    .choice()
>       .when(header(VALUE).isEqualTo(A))
>          .wireTap("direct:wireTapTbd")
>          .<anything else you want here>
>       .otherwise()
>           .to("direct:secondChoice");
>
>
> On Wed, Aug 28, 2013 at 1:08 PM, Christopher Gardner <
> chris.r.gardner@gmail.com> wrote:
>
>> Something like:
>>
>>            from("direct:foo").wireTap("direct:wireTapTbd")
>>                 .choice()
>>                 .when(header("VALUE").isEqualTo("A"))
>>                   .to("direct:firstChoice")
>>                 .otherwise()
>>                   .to("direct:secondChoice");
>>
>>
>> On Wed, Aug 28, 2013 at 3:46 PM, Dale King <da...@gmail.com> wrote:
>>
>> > Just wiretap to a content based router that directs it accordingly.
>> >
>> >
>> > On Wed, Aug 28, 2013 at 3:26 PM, Christopher Gardner <
>> > chris.r.gardner@gmail.com> wrote:
>> >
>> > > Is there a spring and/or Java DSL way to conditionally wiretap? Example
>> > > would be if a header has one value, I'd like to wiretap to "direct:a",
>> if
>> > > it has another value to "direct:b".  The only thing I can think of now
>> is
>> > > to wiretap to "direct:determineWhereToWiretap", which includes a
>> > processor
>> > > on the route to actually check such a header value and route
>> accordingly.
>> > >
>> >
>> >
>> >
>> > --
>> > Dale King
>> >
>>
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Conditional Wiretapping

Posted by Christian Posta <ch...@gmail.com>.
Maybe more like:

from("direct:foo")
   .choice()
      .when(header(VALUE).isEqualTo(A))
         .wireTap("direct:wireTapTbd")
         .<anything else you want here>
      .otherwise()
          .to("direct:secondChoice");


On Wed, Aug 28, 2013 at 1:08 PM, Christopher Gardner <
chris.r.gardner@gmail.com> wrote:

> Something like:
>
>            from("direct:foo").wireTap("direct:wireTapTbd")
>                 .choice()
>                 .when(header("VALUE").isEqualTo("A"))
>                   .to("direct:firstChoice")
>                 .otherwise()
>                   .to("direct:secondChoice");
>
>
> On Wed, Aug 28, 2013 at 3:46 PM, Dale King <da...@gmail.com> wrote:
>
> > Just wiretap to a content based router that directs it accordingly.
> >
> >
> > On Wed, Aug 28, 2013 at 3:26 PM, Christopher Gardner <
> > chris.r.gardner@gmail.com> wrote:
> >
> > > Is there a spring and/or Java DSL way to conditionally wiretap? Example
> > > would be if a header has one value, I'd like to wiretap to "direct:a",
> if
> > > it has another value to "direct:b".  The only thing I can think of now
> is
> > > to wiretap to "direct:determineWhereToWiretap", which includes a
> > processor
> > > on the route to actually check such a header value and route
> accordingly.
> > >
> >
> >
> >
> > --
> > Dale King
> >
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: Conditional Wiretapping

Posted by Christopher Gardner <ch...@gmail.com>.
Something like:

           from("direct:foo").wireTap("direct:wireTapTbd")
                .choice()
                .when(header("VALUE").isEqualTo("A"))
                  .to("direct:firstChoice")
                .otherwise()
                  .to("direct:secondChoice");


On Wed, Aug 28, 2013 at 3:46 PM, Dale King <da...@gmail.com> wrote:

> Just wiretap to a content based router that directs it accordingly.
>
>
> On Wed, Aug 28, 2013 at 3:26 PM, Christopher Gardner <
> chris.r.gardner@gmail.com> wrote:
>
> > Is there a spring and/or Java DSL way to conditionally wiretap? Example
> > would be if a header has one value, I'd like to wiretap to "direct:a", if
> > it has another value to "direct:b".  The only thing I can think of now is
> > to wiretap to "direct:determineWhereToWiretap", which includes a
> processor
> > on the route to actually check such a header value and route accordingly.
> >
>
>
>
> --
> Dale King
>

Re: Conditional Wiretapping

Posted by Dale King <da...@gmail.com>.
Just wiretap to a content based router that directs it accordingly.


On Wed, Aug 28, 2013 at 3:26 PM, Christopher Gardner <
chris.r.gardner@gmail.com> wrote:

> Is there a spring and/or Java DSL way to conditionally wiretap? Example
> would be if a header has one value, I'd like to wiretap to "direct:a", if
> it has another value to "direct:b".  The only thing I can think of now is
> to wiretap to "direct:determineWhereToWiretap", which includes a processor
> on the route to actually check such a header value and route accordingly.
>



-- 
Dale King