You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jay <my...@gmail.com> on 2013/07/31 12:42:54 UTC

AggregatStrategy - issue (Camel) Fuse ESB

Hi, 
I have noticed an issue in Fuse ESB that - it is ignoring the previous
exchanges and considering only the latest exchange if i set the header like
Exchange.CORRELATION_ID or Exchange.FILE_NAME_ONLY.


aggregate(header(Exchange.CORRELATION_ID), new MyAggregator())


Context:- i have 100's of messages to aggregate and process them. but it is
processing only the latest one (last message).


Could some one let me know your views on the issue? 

Note: if i run the above with Camel test locally then it is working fine -
it giving a trouble in Fuse esb.



--
View this message in context: http://servicemix.396122.n5.nabble.com/AggregatStrategy-issue-Camel-Fuse-ESB-tp5717450.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: AggregatStrategy - issue (Camel) Fuse ESB

Posted by jay <my...@gmail.com>.
Hi Gert,
Please find below the route and aggregator;

 from(ACTIVEMQ_INBOUND)
                .aggregate(header(Exchange.FILE_NAME_ONLY), new
MyAggregator())
                .completionTimeout(getAggregationTimeout())
                .beanRef("myprocessor","process")
                .to(ACTIVEMQ_OUTBOUND)
                .end();

Aggregator:
@Override
	public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
		ArrayList<MyObject> objList =null; 
		MyObject objNew = (MyObject)newExchange.getIn().getBody(MyObject.class);
		
		
		if(oldExchange == null)
		    {
            objList = new ArrayList<MyObject>(); 
            objList.add(objNew) ; 
            newExchange.getIn().setBody(objList); 
           
            return newExchange;
            
            }
		else{
			objList=oldExchange.getIn().getBody(ArrayList.class);
			objList.add(objNew);
			
			return oldExchange;
		    }






--
View this message in context: http://servicemix.396122.n5.nabble.com/AggregatStrategy-issue-Camel-Fuse-ESB-tp5717450p5717455.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: AggregatStrategy - issue (Camel) Fuse ESB

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S,

One thing you could do is enable the tracer and/or add a to("log:...")
in the route to ensure the exchanges you're trying to correlate
actually contain the headers you're expecting.  Could you share the
route itself and the code for your custom AggregatorStrategy as well?
What kind of completion configuration are you using with this
aggregator?

Regards,

Gert Vanthienen


On Wed, Jul 31, 2013 at 12:42 PM, jay <my...@gmail.com> wrote:
> Hi,
> I have noticed an issue in Fuse ESB that - it is ignoring the previous
> exchanges and considering only the latest exchange if i set the header like
> Exchange.CORRELATION_ID or Exchange.FILE_NAME_ONLY.
>
>
> aggregate(header(Exchange.CORRELATION_ID), new MyAggregator())
>
>
> Context:- i have 100's of messages to aggregate and process them. but it is
> processing only the latest one (last message).
>
>
> Could some one let me know your views on the issue?
>
> Note: if i run the above with Camel test locally then it is working fine -
> it giving a trouble in Fuse esb.
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/AggregatStrategy-issue-Camel-Fuse-ESB-tp5717450.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.