You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lekkie <le...@gmail.com> on 2010/02/01 17:53:33 UTC

How to control what is sent to client

Hi guys,

I have this sample I am working. hte processor works fine except that the
response sent to the client is not the output form the processor.

Here is my snippet:

<route>
	<from uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
    	<to uri="xslt:requestToSOAP.xsl"/>
      	<wireTap uri="direct:tap"/>      	
   	<to uri="xslt:XMLRequestToManagerRequest.xsl"/>
	<convertBodyTo type="javax.xml.transform.dom.DOMSource" />
      	<to
uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>  
      	<to uri="xslt:ResponseToXMLRequest.xsl"/>    	
	<to uri="direct:tap"/>
</route>

<route>
		<from uri="direct:tap"/>
		<aggregate batchSize="2" batchTimeout="5000" strategyRef="myStrategy">
			<correlationExpression><constant>true</constant></correlationExpression>
			<to uri="direct:aggregated"/>
		</aggregate>
</route>

<route>
		<from uri="direct:aggregated"/>
		<to uri="log:Response3"/> 
</route>

What is logged in log:response3 is the aggregation performed in myStrategy
bean (which is what I expected), however, what I receive on the client that
made this request (and what I see in my network analyzer) is the output from
<to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed response
from nmr:{http://services.locator/}ServicesService:ServicesPort service.

I will appreciate any clue on this.
-- 
View this message in context: http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to control what is sent to client

Posted by Willem Jiang <wi...@gmail.com>.
lekkie wrote:
> What I'd like to do is illustrated below:-
> 
> http client -> Original Request -> first endpoint -> first endpoint response
> 
> (Original Request + first endpoint response [aggregated]) -> second endpoint
> -> second endpoint response
> 
> second endpoint response -> http client
> 
> I have tried multicast but it doesnt return response from second endpoint to
> http client.

If you don't want to use multicast, you can use camel producerTemplate 
to send the request to the first endpoint and aggregate the response in 
your customer processor, and then send the exchange to next endpoint.

Willem


> 
> 
> 
> Stan Lewis-3 wrote:
>> Think you'd want to use either multicast -
>> http://camel.apache.org/multicast.html
>>
>> or pipeline perhaps - http://camel.apache.org/pipes-and-filters.html
>>
>> depending on what you're doing.
>>
>> On Tue, Feb 2, 2010 at 1:00 PM, lekkie <le...@gmail.com> wrote:
>>> Thanks.
>>>
>>> How do I send same message to more than one endpoints, instead of many
>>> messages to one endpoint?
>>>
>>> Is this integration possible?
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>>>> Thanks for your response. Much appreciated.
>>>>>
>>>>> Is there any other EIP that I can use to split a message which will be
>>>>> re-captured together with another message with an aggregator and the
>>>>> result
>>>>> from the aggregator will be sent to the http client?
>>>>>
>>>> The Camel splitter have a build in aggregator, see the split aggregate
>>>> request/reply sample at
>>>> http://camel.apache.org/splitter.html
>>>>
>>>>> kr.
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>> Hi
>>>>>>
>>>>>> If you buy the EIP book
>>>>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>>>>
>>>>>> And read about the wiretap pattern you will not be surprise the output
>>>>>> from the processor is NOT send back to the HTTP client.
>>>>>>
>>>>>> Its a wiretap, the original message will continue to be routed as if
>>>>>> it was newer wiretapped.
>>>>>> So you have to set the reply to be send back to HTTP client from the
>>>>>> original route.
>>>>>>
>>>>>>
>>>>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> I have this sample I am working. hte processor works fine except that
>>>>>>> the
>>>>>>> response sent to the client is not the output form the processor.
>>>>>>>
>>>>>>> Here is my snippet:
>>>>>>>
>>>>>>> <route>
>>>>>>>        <from
>>>>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>>>>        <wireTap uri="direct:tap"/>
>>>>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>>>>        <to
>>>>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>>>>        <to uri="direct:tap"/>
>>>>>>> </route>
>>>>>>>
>>>>>>> <route>
>>>>>>>                <from uri="direct:tap"/>
>>>>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>>>>> strategyRef="myStrategy">
>>>>>>>
>>>>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>>>>                        <to uri="direct:aggregated"/>
>>>>>>>                </aggregate>
>>>>>>> </route>
>>>>>>>
>>>>>>> <route>
>>>>>>>                <from uri="direct:aggregated"/>
>>>>>>>                <to uri="log:Response3"/>
>>>>>>> </route>
>>>>>>>
>>>>>>> What is logged in log:response3 is the aggregation performed in
>>>>>>> myStrategy
>>>>>>> bean (which is what I expected), however, what I receive on the
>>>>>>> client
>>>>>>> that
>>>>>>> made this request (and what I see in my network analyzer) is the
>>>>>>> output
>>>>>>> from
>>>>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>>>>> response
>>>>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>>>>> service.
>>>>>>>
>>>>>>> I will appreciate any clue on this.
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
> 


Re: How to control what is sent to client

Posted by Willem Jiang <wi...@gmail.com>.
lekkie wrote:
> This has been resolved.
> 
> Thanks... especially to Claus.
> 
> ..........
>       <multicast strategyRef="myStrategy">
>             <to uri="direct:firstendpoint"/> 
>         <to uri="direct:secondendpoint"/> 
>       </multicast> 
> <to uri="direct:aggregated"/>
> .......
> 
> Never knew I could use aggregationStrategy for Multicast. I just saw the
> source code and the default constructor accepts one.

If your send request/reply message to a multicast which specify the 
aggregationStrategy, camel will used the default one and return the last 
one exchange to you.

Willem
> 
> 
> lekkie wrote:
>> What I'd like to do is illustrated below:-
>>
>> http client -> Original Request -> first endpoint -> first endpoint
>> response
>>
>> (Original Request + first endpoint response [aggregated]) -> second
>> endpoint -> second endpoint response
>>
>> second endpoint response -> http client
>>
>> I have tried multicast but it doesnt return response from second endpoint
>> to http client instead it returns first endpoint response.
>>
>>
>>
>> Stan Lewis-3 wrote:
>>> Think you'd want to use either multicast -
>>> http://camel.apache.org/multicast.html
>>>
>>> or pipeline perhaps - http://camel.apache.org/pipes-and-filters.html
>>>
>>> depending on what you're doing.
>>>
>>> On Tue, Feb 2, 2010 at 1:00 PM, lekkie <le...@gmail.com> wrote:
>>>> Thanks.
>>>>
>>>> How do I send same message to more than one endpoints, instead of many
>>>> messages to one endpoint?
>>>>
>>>> Is this integration possible?
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>>>>> Thanks for your response. Much appreciated.
>>>>>>
>>>>>> Is there any other EIP that I can use to split a message which will be
>>>>>> re-captured together with another message with an aggregator and the
>>>>>> result
>>>>>> from the aggregator will be sent to the http client?
>>>>>>
>>>>> The Camel splitter have a build in aggregator, see the split aggregate
>>>>> request/reply sample at
>>>>> http://camel.apache.org/splitter.html
>>>>>
>>>>>> kr.
>>>>>>
>>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>> Hi
>>>>>>>
>>>>>>> If you buy the EIP book
>>>>>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>>>>>
>>>>>>> And read about the wiretap pattern you will not be surprise the
>>>>>>> output
>>>>>>> from the processor is NOT send back to the HTTP client.
>>>>>>>
>>>>>>> Its a wiretap, the original message will continue to be routed as if
>>>>>>> it was newer wiretapped.
>>>>>>> So you have to set the reply to be send back to HTTP client from the
>>>>>>> original route.
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com>
>>>>>>> wrote:
>>>>>>>> Hi guys,
>>>>>>>>
>>>>>>>> I have this sample I am working. hte processor works fine except
>>>>>>>> that
>>>>>>>> the
>>>>>>>> response sent to the client is not the output form the processor.
>>>>>>>>
>>>>>>>> Here is my snippet:
>>>>>>>>
>>>>>>>> <route>
>>>>>>>>        <from
>>>>>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>>>>>        <wireTap uri="direct:tap"/>
>>>>>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>>>>>        <to
>>>>>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>>>>>        <to uri="direct:tap"/>
>>>>>>>> </route>
>>>>>>>>
>>>>>>>> <route>
>>>>>>>>                <from uri="direct:tap"/>
>>>>>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>>>>>> strategyRef="myStrategy">
>>>>>>>>
>>>>>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>>>>>                        <to uri="direct:aggregated"/>
>>>>>>>>                </aggregate>
>>>>>>>> </route>
>>>>>>>>
>>>>>>>> <route>
>>>>>>>>                <from uri="direct:aggregated"/>
>>>>>>>>                <to uri="log:Response3"/>
>>>>>>>> </route>
>>>>>>>>
>>>>>>>> What is logged in log:response3 is the aggregation performed in
>>>>>>>> myStrategy
>>>>>>>> bean (which is what I expected), however, what I receive on the
>>>>>>>> client
>>>>>>>> that
>>>>>>>> made this request (and what I see in my network analyzer) is the
>>>>>>>> output
>>>>>>>> from
>>>>>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>>>>>> response
>>>>>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>>>>>> service.
>>>>>>>>
>>>>>>>> I will appreciate any clue on this.
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>
> 


Re: How to control what is sent to client

Posted by lekkie <le...@gmail.com>.
This has been resolved.

Thanks... especially to Claus.

..........
      <multicast strategyRef="myStrategy">
            <to uri="direct:firstendpoint"/> 
        <to uri="direct:secondendpoint"/> 
      </multicast> 
<to uri="direct:aggregated"/>
.......

Never knew I could use aggregationStrategy for Multicast. I just saw the
source code and the default constructor accepts one.


lekkie wrote:
> 
> What I'd like to do is illustrated below:-
> 
> http client -> Original Request -> first endpoint -> first endpoint
> response
> 
> (Original Request + first endpoint response [aggregated]) -> second
> endpoint -> second endpoint response
> 
> second endpoint response -> http client
> 
> I have tried multicast but it doesnt return response from second endpoint
> to http client instead it returns first endpoint response.
> 
> 
> 
> Stan Lewis-3 wrote:
>> 
>> Think you'd want to use either multicast -
>> http://camel.apache.org/multicast.html
>> 
>> or pipeline perhaps - http://camel.apache.org/pipes-and-filters.html
>> 
>> depending on what you're doing.
>> 
>> On Tue, Feb 2, 2010 at 1:00 PM, lekkie <le...@gmail.com> wrote:
>>>
>>> Thanks.
>>>
>>> How do I send same message to more than one endpoints, instead of many
>>> messages to one endpoint?
>>>
>>> Is this integration possible?
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>>>>
>>>>> Thanks for your response. Much appreciated.
>>>>>
>>>>> Is there any other EIP that I can use to split a message which will be
>>>>> re-captured together with another message with an aggregator and the
>>>>> result
>>>>> from the aggregator will be sent to the http client?
>>>>>
>>>>
>>>> The Camel splitter have a build in aggregator, see the split aggregate
>>>> request/reply sample at
>>>> http://camel.apache.org/splitter.html
>>>>
>>>>> kr.
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> If you buy the EIP book
>>>>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>>>>
>>>>>> And read about the wiretap pattern you will not be surprise the
>>>>>> output
>>>>>> from the processor is NOT send back to the HTTP client.
>>>>>>
>>>>>> Its a wiretap, the original message will continue to be routed as if
>>>>>> it was newer wiretapped.
>>>>>> So you have to set the reply to be send back to HTTP client from the
>>>>>> original route.
>>>>>>
>>>>>>
>>>>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> I have this sample I am working. hte processor works fine except
>>>>>>> that
>>>>>>> the
>>>>>>> response sent to the client is not the output form the processor.
>>>>>>>
>>>>>>> Here is my snippet:
>>>>>>>
>>>>>>> <route>
>>>>>>>        <from
>>>>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>>>>        <wireTap uri="direct:tap"/>
>>>>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>>>>        <to
>>>>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>>>>        <to uri="direct:tap"/>
>>>>>>> </route>
>>>>>>>
>>>>>>> <route>
>>>>>>>                <from uri="direct:tap"/>
>>>>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>>>>> strategyRef="myStrategy">
>>>>>>>
>>>>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>>>>                        <to uri="direct:aggregated"/>
>>>>>>>                </aggregate>
>>>>>>> </route>
>>>>>>>
>>>>>>> <route>
>>>>>>>                <from uri="direct:aggregated"/>
>>>>>>>                <to uri="log:Response3"/>
>>>>>>> </route>
>>>>>>>
>>>>>>> What is logged in log:response3 is the aggregation performed in
>>>>>>> myStrategy
>>>>>>> bean (which is what I expected), however, what I receive on the
>>>>>>> client
>>>>>>> that
>>>>>>> made this request (and what I see in my network analyzer) is the
>>>>>>> output
>>>>>>> from
>>>>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>>>>> response
>>>>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>>>>> service.
>>>>>>>
>>>>>>> I will appreciate any clue on this.
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27425435.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to control what is sent to client

Posted by lekkie <le...@gmail.com>.
What I'd like to do is illustrated below:-

http client -> Original Request -> first endpoint -> first endpoint response

(Original Request + first endpoint response [aggregated]) -> second endpoint
-> second endpoint response

second endpoint response -> http client

I have tried multicast but it doesnt return response from second endpoint to
http client.



Stan Lewis-3 wrote:
> 
> Think you'd want to use either multicast -
> http://camel.apache.org/multicast.html
> 
> or pipeline perhaps - http://camel.apache.org/pipes-and-filters.html
> 
> depending on what you're doing.
> 
> On Tue, Feb 2, 2010 at 1:00 PM, lekkie <le...@gmail.com> wrote:
>>
>> Thanks.
>>
>> How do I send same message to more than one endpoints, instead of many
>> messages to one endpoint?
>>
>> Is this integration possible?
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>>>
>>>> Thanks for your response. Much appreciated.
>>>>
>>>> Is there any other EIP that I can use to split a message which will be
>>>> re-captured together with another message with an aggregator and the
>>>> result
>>>> from the aggregator will be sent to the http client?
>>>>
>>>
>>> The Camel splitter have a build in aggregator, see the split aggregate
>>> request/reply sample at
>>> http://camel.apache.org/splitter.html
>>>
>>>> kr.
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> If you buy the EIP book
>>>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>>>
>>>>> And read about the wiretap pattern you will not be surprise the output
>>>>> from the processor is NOT send back to the HTTP client.
>>>>>
>>>>> Its a wiretap, the original message will continue to be routed as if
>>>>> it was newer wiretapped.
>>>>> So you have to set the reply to be send back to HTTP client from the
>>>>> original route.
>>>>>
>>>>>
>>>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>>>>>
>>>>>> Hi guys,
>>>>>>
>>>>>> I have this sample I am working. hte processor works fine except that
>>>>>> the
>>>>>> response sent to the client is not the output form the processor.
>>>>>>
>>>>>> Here is my snippet:
>>>>>>
>>>>>> <route>
>>>>>>        <from
>>>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>>>        <wireTap uri="direct:tap"/>
>>>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>>>        <to
>>>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>>>        <to uri="direct:tap"/>
>>>>>> </route>
>>>>>>
>>>>>> <route>
>>>>>>                <from uri="direct:tap"/>
>>>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>>>> strategyRef="myStrategy">
>>>>>>
>>>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>>>                        <to uri="direct:aggregated"/>
>>>>>>                </aggregate>
>>>>>> </route>
>>>>>>
>>>>>> <route>
>>>>>>                <from uri="direct:aggregated"/>
>>>>>>                <to uri="log:Response3"/>
>>>>>> </route>
>>>>>>
>>>>>> What is logged in log:response3 is the aggregation performed in
>>>>>> myStrategy
>>>>>> bean (which is what I expected), however, what I receive on the
>>>>>> client
>>>>>> that
>>>>>> made this request (and what I see in my network analyzer) is the
>>>>>> output
>>>>>> from
>>>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>>>> response
>>>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>>>> service.
>>>>>>
>>>>>> I will appreciate any clue on this.
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27425176.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to control what is sent to client

Posted by Stan Lewis <ga...@gmail.com>.
Think you'd want to use either multicast -
http://camel.apache.org/multicast.html

or pipeline perhaps - http://camel.apache.org/pipes-and-filters.html

depending on what you're doing.

On Tue, Feb 2, 2010 at 1:00 PM, lekkie <le...@gmail.com> wrote:
>
> Thanks.
>
> How do I send same message to more than one endpoints, instead of many
> messages to one endpoint?
>
> Is this integration possible?
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>>
>>> Thanks for your response. Much appreciated.
>>>
>>> Is there any other EIP that I can use to split a message which will be
>>> re-captured together with another message with an aggregator and the
>>> result
>>> from the aggregator will be sent to the http client?
>>>
>>
>> The Camel splitter have a build in aggregator, see the split aggregate
>> request/reply sample at
>> http://camel.apache.org/splitter.html
>>
>>> kr.
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Hi
>>>>
>>>> If you buy the EIP book
>>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>>
>>>> And read about the wiretap pattern you will not be surprise the output
>>>> from the processor is NOT send back to the HTTP client.
>>>>
>>>> Its a wiretap, the original message will continue to be routed as if
>>>> it was newer wiretapped.
>>>> So you have to set the reply to be send back to HTTP client from the
>>>> original route.
>>>>
>>>>
>>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>>>>
>>>>> Hi guys,
>>>>>
>>>>> I have this sample I am working. hte processor works fine except that
>>>>> the
>>>>> response sent to the client is not the output form the processor.
>>>>>
>>>>> Here is my snippet:
>>>>>
>>>>> <route>
>>>>>        <from
>>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>>        <wireTap uri="direct:tap"/>
>>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>>        <to
>>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>>        <to uri="direct:tap"/>
>>>>> </route>
>>>>>
>>>>> <route>
>>>>>                <from uri="direct:tap"/>
>>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>>> strategyRef="myStrategy">
>>>>>
>>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>>                        <to uri="direct:aggregated"/>
>>>>>                </aggregate>
>>>>> </route>
>>>>>
>>>>> <route>
>>>>>                <from uri="direct:aggregated"/>
>>>>>                <to uri="log:Response3"/>
>>>>> </route>
>>>>>
>>>>> What is logged in log:response3 is the aggregation performed in
>>>>> myStrategy
>>>>> bean (which is what I expected), however, what I receive on the client
>>>>> that
>>>>> made this request (and what I see in my network analyzer) is the output
>>>>> from
>>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>>> response
>>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>>> service.
>>>>>
>>>>> I will appreciate any clue on this.
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: How to control what is sent to client

Posted by lekkie <le...@gmail.com>.
Thanks.

How do I send same message to more than one endpoints, instead of many
messages to one endpoint?

Is this integration possible?



Claus Ibsen-2 wrote:
> 
> On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>>
>> Thanks for your response. Much appreciated.
>>
>> Is there any other EIP that I can use to split a message which will be
>> re-captured together with another message with an aggregator and the
>> result
>> from the aggregator will be sent to the http client?
>>
> 
> The Camel splitter have a build in aggregator, see the split aggregate
> request/reply sample at
> http://camel.apache.org/splitter.html
> 
>> kr.
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> If you buy the EIP book
>>> http://www.enterpriseintegrationpatterns.com/index.html
>>>
>>> And read about the wiretap pattern you will not be surprise the output
>>> from the processor is NOT send back to the HTTP client.
>>>
>>> Its a wiretap, the original message will continue to be routed as if
>>> it was newer wiretapped.
>>> So you have to set the reply to be send back to HTTP client from the
>>> original route.
>>>
>>>
>>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>>>
>>>> Hi guys,
>>>>
>>>> I have this sample I am working. hte processor works fine except that
>>>> the
>>>> response sent to the client is not the output form the processor.
>>>>
>>>> Here is my snippet:
>>>>
>>>> <route>
>>>>        <from
>>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>>        <wireTap uri="direct:tap"/>
>>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>>        <to
>>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>>        <to uri="direct:tap"/>
>>>> </route>
>>>>
>>>> <route>
>>>>                <from uri="direct:tap"/>
>>>>                <aggregate batchSize="2" batchTimeout="5000"
>>>> strategyRef="myStrategy">
>>>>
>>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>>                        <to uri="direct:aggregated"/>
>>>>                </aggregate>
>>>> </route>
>>>>
>>>> <route>
>>>>                <from uri="direct:aggregated"/>
>>>>                <to uri="log:Response3"/>
>>>> </route>
>>>>
>>>> What is logged in log:response3 is the aggregation performed in
>>>> myStrategy
>>>> bean (which is what I expected), however, what I receive on the client
>>>> that
>>>> made this request (and what I see in my network analyzer) is the output
>>>> from
>>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>>> response
>>>> from nmr:{http://services.locator/}ServicesService:ServicesPort
>>>> service.
>>>>
>>>> I will appreciate any clue on this.
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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/How-to-control-what-is-sent-to-client-tp27407409p27424728.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to control what is sent to client

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Feb 2, 2010 at 1:58 PM, lekkie <le...@gmail.com> wrote:
>
> Thanks for your response. Much appreciated.
>
> Is there any other EIP that I can use to split a message which will be
> re-captured together with another message with an aggregator and the result
> from the aggregator will be sent to the http client?
>

The Camel splitter have a build in aggregator, see the split aggregate
request/reply sample at
http://camel.apache.org/splitter.html

> kr.
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> If you buy the EIP book
>> http://www.enterpriseintegrationpatterns.com/index.html
>>
>> And read about the wiretap pattern you will not be surprise the output
>> from the processor is NOT send back to the HTTP client.
>>
>> Its a wiretap, the original message will continue to be routed as if
>> it was newer wiretapped.
>> So you have to set the reply to be send back to HTTP client from the
>> original route.
>>
>>
>> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>>
>>> Hi guys,
>>>
>>> I have this sample I am working. hte processor works fine except that the
>>> response sent to the client is not the output form the processor.
>>>
>>> Here is my snippet:
>>>
>>> <route>
>>>        <from
>>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>>        <to uri="xslt:requestToSOAP.xsl"/>
>>>        <wireTap uri="direct:tap"/>
>>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>>        <to
>>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>>        <to uri="direct:tap"/>
>>> </route>
>>>
>>> <route>
>>>                <from uri="direct:tap"/>
>>>                <aggregate batchSize="2" batchTimeout="5000"
>>> strategyRef="myStrategy">
>>>
>>>  <correlationExpression><constant>true</constant></correlationExpression>
>>>                        <to uri="direct:aggregated"/>
>>>                </aggregate>
>>> </route>
>>>
>>> <route>
>>>                <from uri="direct:aggregated"/>
>>>                <to uri="log:Response3"/>
>>> </route>
>>>
>>> What is logged in log:response3 is the aggregation performed in
>>> myStrategy
>>> bean (which is what I expected), however, what I receive on the client
>>> that
>>> made this request (and what I see in my network analyzer) is the output
>>> from
>>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>>> response
>>> from nmr:{http://services.locator/}ServicesService:ServicesPort service.
>>>
>>> I will appreciate any clue on this.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.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: How to control what is sent to client

Posted by lekkie <le...@gmail.com>.
Thanks for your response. Much appreciated.

Is there any other EIP that I can use to split a message which will be
re-captured together with another message with an aggregator and the result
from the aggregator will be sent to the http client?

kr.


Claus Ibsen-2 wrote:
> 
> Hi
> 
> If you buy the EIP book
> http://www.enterpriseintegrationpatterns.com/index.html
> 
> And read about the wiretap pattern you will not be surprise the output
> from the processor is NOT send back to the HTTP client.
> 
> Its a wiretap, the original message will continue to be routed as if
> it was newer wiretapped.
> So you have to set the reply to be send back to HTTP client from the
> original route.
> 
> 
> On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>>
>> Hi guys,
>>
>> I have this sample I am working. hte processor works fine except that the
>> response sent to the client is not the output form the processor.
>>
>> Here is my snippet:
>>
>> <route>
>>        <from
>> uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>>        <to uri="xslt:requestToSOAP.xsl"/>
>>        <wireTap uri="direct:tap"/>
>>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>        <to
>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>>        <to uri="direct:tap"/>
>> </route>
>>
>> <route>
>>                <from uri="direct:tap"/>
>>                <aggregate batchSize="2" batchTimeout="5000"
>> strategyRef="myStrategy">
>>                      
>>  <correlationExpression><constant>true</constant></correlationExpression>
>>                        <to uri="direct:aggregated"/>
>>                </aggregate>
>> </route>
>>
>> <route>
>>                <from uri="direct:aggregated"/>
>>                <to uri="log:Response3"/>
>> </route>
>>
>> What is logged in log:response3 is the aggregation performed in
>> myStrategy
>> bean (which is what I expected), however, what I receive on the client
>> that
>> made this request (and what I see in my network analyzer) is the output
>> from
>> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed
>> response
>> from nmr:{http://services.locator/}ServicesService:ServicesPort service.
>>
>> I will appreciate any clue on this.
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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/How-to-control-what-is-sent-to-client-tp27407409p27419927.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to control what is sent to client

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

If you buy the EIP book
http://www.enterpriseintegrationpatterns.com/index.html

And read about the wiretap pattern you will not be surprise the output
from the processor is NOT send back to the HTTP client.

Its a wiretap, the original message will continue to be routed as if
it was newer wiretapped.
So you have to set the reply to be send back to HTTP client from the
original route.


On Mon, Feb 1, 2010 at 5:53 PM, lekkie <le...@gmail.com> wrote:
>
> Hi guys,
>
> I have this sample I am working. hte processor works fine except that the
> response sent to the client is not the output form the processor.
>
> Here is my snippet:
>
> <route>
>        <from uri="jetty:http://0.0.0.0:9001/service?matchOnUriPrefix=true" />
>        <to uri="xslt:requestToSOAP.xsl"/>
>        <wireTap uri="direct:tap"/>
>        <to uri="xslt:XMLRequestToManagerRequest.xsl"/>
>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>        <to
> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>        <to uri="xslt:ResponseToXMLRequest.xsl"/>
>        <to uri="direct:tap"/>
> </route>
>
> <route>
>                <from uri="direct:tap"/>
>                <aggregate batchSize="2" batchTimeout="5000" strategyRef="myStrategy">
>                        <correlationExpression><constant>true</constant></correlationExpression>
>                        <to uri="direct:aggregated"/>
>                </aggregate>
> </route>
>
> <route>
>                <from uri="direct:aggregated"/>
>                <to uri="log:Response3"/>
> </route>
>
> What is logged in log:response3 is the aggregation performed in myStrategy
> bean (which is what I expected), however, what I receive on the client that
> made this request (and what I see in my network analyzer) is the output from
> <to uri="xslt:ResponseToXMLRequest.xsl"/>  which is the transformed response
> from nmr:{http://services.locator/}ServicesService:ServicesPort service.
>
> I will appreciate any clue on this.
> --
> View this message in context: http://old.nabble.com/How-to-control-what-is-sent-to-client-tp27407409p27407409.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