You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Happy User <ha...@gmail.com> on 2014/05/30 05:00:52 UTC

Pls Help - Wiretap Pattern

Example scenario - External caller calls the blueprint and bp has 2 routes.

<route1>
<from uri="triggerURI"/>
<to uri="webserviceURI"/>
<wiretap uri="direct:secondRoute"/>
</route1>

<route2>
<from uri="direct:secondRoute"/>
<log message="Second Route"/>
</route2>

QNS:

1. wiretap send a response(came from the webserviceURI) to external caller
back and call the second route as well - Is my understanding correct?
2. if yes, will we be able to enforce a condition that wiretap should send
response to external caller first and then should proceed with second
route?. If that enforcement is not achievable by wiretap, which pattern
should i use to return response to caller as we as proceed with the next
route?

-Thanks

Re: Pls Help - Wiretap Pattern

Posted by "kraythe ." <kr...@gmail.com>.
Why would wire taps be dependent on order? I think you may be trying to use
wiretap for the wrong use case. Wiretaps make a copy of the exchange and
then send that asynchronously to the endpoint. They are used for listening
in on exchanges not ordered firing.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Sat, May 31, 2014 at 9:44 AM, Happy User <ha...@gmail.com>
wrote:

> Thank you..
>
> On Friday, May 30, 2014, Mark Frazier <mm...@icloud.com> wrote:
>
> > Short answer to 1) yes.
> >
> > Assuming I’m understanding you correctly, if your first route is an inOut
> > exchange, then the response from
> > webserviceURI will be sent back, it will be done independently of the
> > exchange being sent to the second route.
> >
> > The second route will be executed in a separate thread, and that exchange
> > will be inOnly.
> >
> > Ie, they will run in parallel .
> >
> > http://camel.apache.org/wire-tap.html
> >
> > On May 29, 2014, at 8:00 PM, Happy User <happyuser828612@gmail.com
> > <javascript:;>> wrote:
> >
> > > Example scenario - External caller calls the blueprint and bp has 2
> > routes.
> > >
> > > <route1>
> > > <from uri="triggerURI"/>
> > > <to uri="webserviceURI"/>
> > > <wiretap uri="direct:secondRoute"/>
> > > </route1>
> > >
> > > <route2>
> > > <from uri="direct:secondRoute"/>
> > > <log message="Second Route"/>
> > > </route2>
> > >
> > > QNS:
> > >
> > > 1. wiretap send a response(came from the webserviceURI) to external
> > caller
> > > back and call the second route as well - Is my understanding correct?
> > > 2. if yes, will we be able to enforce a condition that wiretap should
> > send
> > > response to external caller first and then should proceed with second
> > > route?. If that enforcement is not achievable by wiretap, which pattern
> > > should i use to return response to caller as we as proceed with the
> next
> > > route?
> > >
> > > -Thanks
> >
> >
>

Re: Pls Help - Wiretap Pattern

Posted by Happy User <ha...@gmail.com>.
Thank you..

On Friday, May 30, 2014, Mark Frazier <mm...@icloud.com> wrote:

> Short answer to 1) yes.
>
> Assuming I’m understanding you correctly, if your first route is an inOut
> exchange, then the response from
> webserviceURI will be sent back, it will be done independently of the
> exchange being sent to the second route.
>
> The second route will be executed in a separate thread, and that exchange
> will be inOnly.
>
> Ie, they will run in parallel .
>
> http://camel.apache.org/wire-tap.html
>
> On May 29, 2014, at 8:00 PM, Happy User <happyuser828612@gmail.com
> <javascript:;>> wrote:
>
> > Example scenario - External caller calls the blueprint and bp has 2
> routes.
> >
> > <route1>
> > <from uri="triggerURI"/>
> > <to uri="webserviceURI"/>
> > <wiretap uri="direct:secondRoute"/>
> > </route1>
> >
> > <route2>
> > <from uri="direct:secondRoute"/>
> > <log message="Second Route"/>
> > </route2>
> >
> > QNS:
> >
> > 1. wiretap send a response(came from the webserviceURI) to external
> caller
> > back and call the second route as well - Is my understanding correct?
> > 2. if yes, will we be able to enforce a condition that wiretap should
> send
> > response to external caller first and then should proceed with second
> > route?. If that enforcement is not achievable by wiretap, which pattern
> > should i use to return response to caller as we as proceed with the next
> > route?
> >
> > -Thanks
>
>

Re: Pls Help - Wiretap Pattern

Posted by Mark Frazier <mm...@icloud.com>.
Short answer to 1) yes.

Assuming I’m understanding you correctly, if your first route is an inOut exchange, then the response from 
webserviceURI will be sent back, it will be done independently of the exchange being sent to the second route.

The second route will be executed in a separate thread, and that exchange will be inOnly.

Ie, they will run in parallel .

http://camel.apache.org/wire-tap.html

On May 29, 2014, at 8:00 PM, Happy User <ha...@gmail.com> wrote:

> Example scenario - External caller calls the blueprint and bp has 2 routes.
> 
> <route1>
> <from uri="triggerURI"/>
> <to uri="webserviceURI"/>
> <wiretap uri="direct:secondRoute"/>
> </route1>
> 
> <route2>
> <from uri="direct:secondRoute"/>
> <log message="Second Route"/>
> </route2>
> 
> QNS:
> 
> 1. wiretap send a response(came from the webserviceURI) to external caller
> back and call the second route as well - Is my understanding correct?
> 2. if yes, will we be able to enforce a condition that wiretap should send
> response to external caller first and then should proceed with second
> route?. If that enforcement is not achievable by wiretap, which pattern
> should i use to return response to caller as we as proceed with the next
> route?
> 
> -Thanks