You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Danny Kruitbosch <da...@gmail.com> on 2010/02/10 10:39:58 UTC

Wiretap filter

Hi,

I've been looking into the new wiretap in Camel 2.x and I have some
questions about it. (Actually using camel in servicemix 4)
I want to use it to tap the response of a request/reply web service so I'm
not at all interested in the request.
1) Will the wiretap "catch" both the request and response and send it to the
tap destination?
2) Is there any way to filter out the responses only? If so, how

E.g. will this work:
      <route>
         <from uri="some_cxf_consumer"/>
         <filter>
            <xpath>/foo:root</xpath>
            <wireTap uri="file:///data/esb/taps"/>
         </filter>        
         <to uri="some_cxf_producer"/>
      </route>
where the XPath resolver to the root of the soap body of my response.

If not how can I accomplish a "wiretap" on the responses of a request/reply
web service.

Thanks,

Danny
-- 
View this message in context: http://old.nabble.com/Wiretap-filter-tp27527108p27527108.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Wiretap filter

Posted by Danny Kruitbosch <da...@gmail.com>.
Hi Claus,

Thanks for the hint, this seems to be what I'm looking for. As I understand
correctly I can add any kind of processing and filtering into the onComplete
part of my route so I can even do my xslt transforms before sending the
payload to it's destination which is great.

Danny

Danny Kruitbosch wrote:
> 
> Hi,
> 
> I've been looking into the new wiretap in Camel 2.x and I have some
> questions about it. (Actually using camel in servicemix 4)
> I want to use it to tap the response of a request/reply web service so I'm
> not at all interested in the request.
> 1) Will the wiretap "catch" both the request and response and send it to
> the tap destination?
> 2) Is there any way to filter out the responses only? If so, how
> 
> E.g. will this work:
>       <route>
>          <from uri="some_cxf_consumer"/>
>          <filter>
>             <xpath>/foo:root</xpath>
>             <wireTap uri="file:///data/esb/taps"/>
>          </filter>        
>          <to uri="some_cxf_producer"/>
>       </route>
> where the XPath resolver to the root of the soap body of my response.
> 
> If not how can I accomplish a "wiretap" on the responses of a
> request/reply web service.
> 
> Thanks,
> 
> Danny
> 

-- 
View this message in context: http://old.nabble.com/Wiretap-filter-tp27527108p27531058.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Wiretap filter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I would suggest to try without JBI and use direct or other kind of
components to get the route correct and have the wireTap, tap what you
want.
Then you can get back to include the JBI part.


On Thu, Apr 15, 2010 at 4:29 PM, Danny Kruitbosch
<da...@gmail.com> wrote:
>
> Hi Claus,
>
> I'm still having trouble with this. When I create a route with the
> onCompletion in it like the following example:
>
> <route>
>                        <from uri="jbi:endpoint:http://nsp.rdc.nl/RDC/diensten/EKIRouter/EKIRP"/>
>                        <to uri="jbi:endpoint:http://nsp.rdc.nl/RDC/diensten/EKI/EKI"/>
>                        <onCompletion onCompleteOnly="true">
>                                <filter>
>
> <xpath>/s11:Envelope/s11:Body/rdc:opvoerenMeldingGoedkeuringAPKAntw</xpath>
>                                        <to uri="file:/data/esbresources/tap?fileName=wireTap.txt"/>
>                </filter>
>                        </onCompletion>
>                </route>
>
> I still don't see the response of the exchange in the wireTap.txt although
> the xpath expression selects the reponse of the soap message. When I leave
> out the filter, than the request message is stored in wireTap.txt.
>
> So any hints how to get the "out" part of the message exchange. Preferably
> by some xpath expression.
>
> Thanks in advance,
>
> Danny
>
> Claus Ibsen-2 wrote:
>>
>> On Wed, Feb 10, 2010 at 10:39 AM, Danny Kruitbosch
>> <da...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I've been looking into the new wiretap in Camel 2.x and I have some
>>> questions about it. (Actually using camel in servicemix 4)
>>> I want to use it to tap the response of a request/reply web service so
>>> I'm
>>> not at all interested in the request.
>>> 1) Will the wiretap "catch" both the request and response and send it to
>>> the
>>> tap destination?
>>> 2) Is there any way to filter out the responses only? If so, how
>>>
>>> E.g. will this work:
>>>      <route>
>>>         <from uri="some_cxf_consumer"/>
>>>         <filter>
>>>            <xpath>/foo:root</xpath>
>>>            <wireTap uri="file:///data/esb/taps"/>
>>>         </filter>
>>>         <to uri="some_cxf_producer"/>
>>>      </route>
>>> where the XPath resolver to the root of the soap body of my response.
>>>
>>> If not how can I accomplish a "wiretap" on the responses of a
>>> request/reply
>>> web service.
>>>
>>
>> You can use onCompletion which is triggered when the Exchange is done,
>> and hence when you have the response ready.
>> http://camel.apache.org/oncompletion.html
>>
>>> Thanks,
>>>
>>> Danny
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Wiretap-filter-tp27527108p27527108.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Wiretap-filter-tp27527108p28256047.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Wiretap filter

Posted by Danny Kruitbosch <da...@gmail.com>.
Hi Claus,

I'm still having trouble with this. When I create a route with the
onCompletion in it like the following example:

<route>
			<from uri="jbi:endpoint:http://nsp.rdc.nl/RDC/diensten/EKIRouter/EKIRP"/>
			<to uri="jbi:endpoint:http://nsp.rdc.nl/RDC/diensten/EKI/EKI"/>
			<onCompletion onCompleteOnly="true">
				<filter>
				
<xpath>/s11:Envelope/s11:Body/rdc:opvoerenMeldingGoedkeuringAPKAntw</xpath>
					<to uri="file:/data/esbresources/tap?fileName=wireTap.txt"/>
                </filter>
			</onCompletion>
		</route>

I still don't see the response of the exchange in the wireTap.txt although
the xpath expression selects the reponse of the soap message. When I leave
out the filter, than the request message is stored in wireTap.txt.

So any hints how to get the "out" part of the message exchange. Preferably
by some xpath expression.

Thanks in advance,

Danny

Claus Ibsen-2 wrote:
> 
> On Wed, Feb 10, 2010 at 10:39 AM, Danny Kruitbosch
> <da...@gmail.com> wrote:
>>
>> Hi,
>>
>> I've been looking into the new wiretap in Camel 2.x and I have some
>> questions about it. (Actually using camel in servicemix 4)
>> I want to use it to tap the response of a request/reply web service so
>> I'm
>> not at all interested in the request.
>> 1) Will the wiretap "catch" both the request and response and send it to
>> the
>> tap destination?
>> 2) Is there any way to filter out the responses only? If so, how
>>
>> E.g. will this work:
>>      <route>
>>         <from uri="some_cxf_consumer"/>
>>         <filter>
>>            <xpath>/foo:root</xpath>
>>            <wireTap uri="file:///data/esb/taps"/>
>>         </filter>
>>         <to uri="some_cxf_producer"/>
>>      </route>
>> where the XPath resolver to the root of the soap body of my response.
>>
>> If not how can I accomplish a "wiretap" on the responses of a
>> request/reply
>> web service.
>>
> 
> You can use onCompletion which is triggered when the Exchange is done,
> and hence when you have the response ready.
> http://camel.apache.org/oncompletion.html
> 
>> Thanks,
>>
>> Danny
>> --
>> View this message in context:
>> http://old.nabble.com/Wiretap-filter-tp27527108p27527108.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Wiretap-filter-tp27527108p28256047.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Wiretap filter

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Feb 10, 2010 at 10:39 AM, Danny Kruitbosch
<da...@gmail.com> wrote:
>
> Hi,
>
> I've been looking into the new wiretap in Camel 2.x and I have some
> questions about it. (Actually using camel in servicemix 4)
> I want to use it to tap the response of a request/reply web service so I'm
> not at all interested in the request.
> 1) Will the wiretap "catch" both the request and response and send it to the
> tap destination?
> 2) Is there any way to filter out the responses only? If so, how
>
> E.g. will this work:
>      <route>
>         <from uri="some_cxf_consumer"/>
>         <filter>
>            <xpath>/foo:root</xpath>
>            <wireTap uri="file:///data/esb/taps"/>
>         </filter>
>         <to uri="some_cxf_producer"/>
>      </route>
> where the XPath resolver to the root of the soap body of my response.
>
> If not how can I accomplish a "wiretap" on the responses of a request/reply
> web service.
>

You can use onCompletion which is triggered when the Exchange is done,
and hence when you have the response ready.
http://camel.apache.org/oncompletion.html

> Thanks,
>
> Danny
> --
> View this message in context: http://old.nabble.com/Wiretap-filter-tp27527108p27527108.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus