Hi

Yes you need to use your own aggregation strategy to "build" the
combined single message as you like.
The default Camel uses just returns the last message hence why you see aaa.

In spring XML there should be a strategyRef attribute you need to
refer to a spring bean that implements the
org.apache.camel.processor.aggregate.AggregatorStrategy interface.

In the future we want to be able for you to use a regular POJO but for
now you have to use that interface.

See more here:
http://camel.apache.org/aggregator.html


On Fri, Aug 14, 2009 at 1:17 PM, Serge Merzliakov<[email protected]> wrote:
>
> Hello,
>   Perhaps I have misunderstood what aggregation can do - ideally
> concatenate message bodies without using java code to concatenate messages
> together. My goal is to concatenate lots of messages into a single message
> e.g.
>
> message 1 body --> 'aaa'
> message 2 body --> 'aaa'
>
> which results in a single message with body --> 'aaaaaa'
>
> My spring DSL works in that 2 messages result in 1, but the message body is
> not a concatenation but only a single message 'aaa'. Here is the Spring DSL:
>
>  <camelContext>
>   <route id="myroute" >
>       <from uri="activemq:queue:source" />
>           <aggregate batchSize="2" >
>                <correlationExpression>
>                   <constant>true</constant>
>                </correlationExpression>
>                <to uri="activemq:queue:dest" />
>           </aggregate>
>     </route>
> </camelContext>
>
> I suspect that I need to write a custom aggregator bean (I have seen the
> samples) to append the message bodies myself. Is this true ?
>
>
> Regards,
> Serge
>
>
> --
> View this message in context: 
> http://www.nabble.com/Aggregator---message-body-not-concatenated-tp24970043p24970043.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to