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/01/20 20:35:44 UTC

Aggregator's old Exchange returns null

I have a custom aggregator set up. The custom aggregator combines the
exchanges of an old and new one and returns them as one.

However, when I log the old exchange to the ESB log file, it returns null.

See my snippet below

.....

 <route>
    	<from uri="direct:RequestProcessor" />
    	<to uri="log:Request"/>
    	<wireTap uri="direct:ProcessorServices"/> 	
    	<to uri="xslt:requestToManager.xsl"/>
    	<convertBodyTo type="javax.xml.transform.dom.DOMSource" />
      	<to
uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
      	<convertBodyTo type="javax.xml.transform.stream.StreamSource" />
      	<to uri="direct:ProcessorServices"/>
    </route>
    
    <route>
    	<from uri="direct:ProcessorServices" />
    	<to uri="log:Request"/>
    	<aggregate strategyRef="myAggregatorStrategy" batchSize="2"
outBatchSize="2"> 
    		<to uri="mock:result"/>
      		<to uri="log:Response"/>
	    </aggregate>
    </route>

what could b d prob?
-- 
View this message in context: http://old.nabble.com/Aggregator%27s-old-Exchange-returns-null-tp27247326p27247326.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator's old Exchange returns null

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can find more explanation in the wiki [1] of AggregationStrategy 
changed in Camel 2.0

http://camel.apache.org/aggregator.html

Willem

Claus Ibsen wrote:
> Hi
> 
> The oldExchange is null on the first invocation of the aggregation strategy.
> 
> 
> On Wed, Jan 20, 2010 at 8:35 PM, lekkie <le...@gmail.com> wrote:
>> I have a custom aggregator set up. The custom aggregator combines the
>> exchanges of an old and new one and returns them as one.
>>
>> However, when I log the old exchange to the ESB log file, it returns null.
>>
>> See my snippet below
>>
>> .....
>>
>>  <route>
>>        <from uri="direct:RequestProcessor" />
>>        <to uri="log:Request"/>
>>        <wireTap uri="direct:ProcessorServices"/>
>>        <to uri="xslt:requestToManager.xsl"/>
>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>        <to
>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>        <convertBodyTo type="javax.xml.transform.stream.StreamSource" />
>>        <to uri="direct:ProcessorServices"/>
>>    </route>
>>
>>    <route>
>>        <from uri="direct:ProcessorServices" />
>>        <to uri="log:Request"/>
>>        <aggregate strategyRef="myAggregatorStrategy" batchSize="2"
>> outBatchSize="2">
>>                <to uri="mock:result"/>
>>                <to uri="log:Response"/>
>>            </aggregate>
>>    </route>
>>
>> what could b d prob?
>> --
>> View this message in context: http://old.nabble.com/Aggregator%27s-old-Exchange-returns-null-tp27247326p27247326.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 


Re: Aggregator's old Exchange returns null

Posted by lekkie <le...@gmail.com>.
Thanks for your quick reply.

This is a lil bit confusing for me. Just to clarify if this is what you
meant.

>From my snippet above, my first invocation on aggrgation strategy will be
the wiretap (<wireTap uri="direct:ProcessorServices"/>) which I expect
myaggregation should capture the accompanying (exhange). What you are saying
is that exchange is not captured by aggregation strategy.

So if I want to capture the exchange wire-tapped from my snippet above, how
would you recommend I do it?

thnx.


Claus Ibsen-2 wrote:
> 
> Hi
> 
> The oldExchange is null on the first invocation of the aggregation
> strategy.
> 
> 
> On Wed, Jan 20, 2010 at 8:35 PM, lekkie <le...@gmail.com> wrote:
>>
>> I have a custom aggregator set up. The custom aggregator combines the
>> exchanges of an old and new one and returns them as one.
>>
>> However, when I log the old exchange to the ESB log file, it returns
>> null.
>>
>> See my snippet below
>>
>> .....
>>
>>  <route>
>>        <from uri="direct:RequestProcessor" />
>>        <to uri="log:Request"/>
>>        <wireTap uri="direct:ProcessorServices"/>
>>        <to uri="xslt:requestToManager.xsl"/>
>>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>>        <to
>> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>>        <convertBodyTo type="javax.xml.transform.stream.StreamSource" />
>>        <to uri="direct:ProcessorServices"/>
>>    </route>
>>
>>    <route>
>>        <from uri="direct:ProcessorServices" />
>>        <to uri="log:Request"/>
>>        <aggregate strategyRef="myAggregatorStrategy" batchSize="2"
>> outBatchSize="2">
>>                <to uri="mock:result"/>
>>                <to uri="log:Response"/>
>>            </aggregate>
>>    </route>
>>
>> what could b d prob?
>> --
>> View this message in context:
>> http://old.nabble.com/Aggregator%27s-old-Exchange-returns-null-tp27247326p27247326.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/Aggregator%27s-old-Exchange-returns-null-tp27247326p27248971.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator's old Exchange returns null

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

The oldExchange is null on the first invocation of the aggregation strategy.


On Wed, Jan 20, 2010 at 8:35 PM, lekkie <le...@gmail.com> wrote:
>
> I have a custom aggregator set up. The custom aggregator combines the
> exchanges of an old and new one and returns them as one.
>
> However, when I log the old exchange to the ESB log file, it returns null.
>
> See my snippet below
>
> .....
>
>  <route>
>        <from uri="direct:RequestProcessor" />
>        <to uri="log:Request"/>
>        <wireTap uri="direct:ProcessorServices"/>
>        <to uri="xslt:requestToManager.xsl"/>
>        <convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>        <to
> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>        <convertBodyTo type="javax.xml.transform.stream.StreamSource" />
>        <to uri="direct:ProcessorServices"/>
>    </route>
>
>    <route>
>        <from uri="direct:ProcessorServices" />
>        <to uri="log:Request"/>
>        <aggregate strategyRef="myAggregatorStrategy" batchSize="2"
> outBatchSize="2">
>                <to uri="mock:result"/>
>                <to uri="log:Response"/>
>            </aggregate>
>    </route>
>
> what could b d prob?
> --
> View this message in context: http://old.nabble.com/Aggregator%27s-old-Exchange-returns-null-tp27247326p27247326.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: Aggregator's old Exchange returns null

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



lekkie wrote:
> 
> I have a custom aggregator set up. The custom aggregator combines the
> exchanges of an old and new one and returns them as one.
> 
> However, when I log the old exchange to the ESB log file, it returns null.
> 
> See my snippet below
> 
> .....
> 
>  <route>
>     	<from uri="direct:RequestProcessor" />
>     	<to uri="log:Request"/>
>     	<wireTap uri="direct:ProcessorServices"/> 	
>     	<to uri="xslt:requestToManager.xsl"/>
>     	<convertBodyTo type="javax.xml.transform.dom.DOMSource" />
>       	<to
> uri="nmr:{http://services.locator/}ServicesService:ServicesPort"/>
>       	<convertBodyTo type="javax.xml.transform.stream.StreamSource" />
>       	<to uri="direct:ProcessorServices"/>
>     </route>
>     
>     <route>
>     	<from uri="direct:ProcessorServices" />
>     	<to uri="log:Request"/>
>     	<aggregate strategyRef="myAggregatorStrategy" batchSize="2"
> outBatchSize="2"> 
>     		<to uri="mock:result"/>
>       		<to uri="log:Response"/>
> 	    </aggregate>
>     </route>
> 
> what could b d prob?
> 

-- 
View this message in context: http://old.nabble.com/Aggregator%27s-old-Exchange-returns-null-tp27247326p27270248.html
Sent from the Camel - Users mailing list archive at Nabble.com.