>> Are you really sure as its supposed to store a List<Object> that are
the message body.

Yes, wanting to accumulate List<Object> over a period of time so before
passing into a "full changes" object so that batching of the request to a
3rd party api can occur.

I'm using Camel 3.1.0, and more detail / output from my route follows (note
- having issues w/ log4j - will look at that after this, first things
first):

        from(Routes.InitialRoute)
            .process(
                (Exchange ex) -> { Logger.getLogger().error("**** Exchange:
" + ex.getIn().getBody()); }
            )
            .aggregate(simple("${body.id}"),
AggregationStrategies.groupedBody())
                .completionTimeout(5000L)
            .process(
                (Exchange ex) -> { Logger.getLogger().error("****
Exchange2: " + ex.getIn().getBody()); }
            )
            .to(ChangeNotificationRoute.ROUTE_TO_WATERSHED);

with an output of :

2020/Apr/04 09:59:03.233 ERROR ....MyChangeRoute.lambda$configure$0: ****
Exchange: {change:'user', id:'ekp000002600', field:'FIELD', new:'1',
old:'null'}
2020/Apr/04 09:59:08.770 ERROR ....MyChangeRoute.lambda$configure$1: ****
Exchange2: List<Exchange>(1 elements)

Note that the Routes.InitialRoute is returning a vm:// endpoint.



On Sat, Apr 4, 2020 at 3:50 AM Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> Are you really sure as its supposed to store a List<Object> that are
> the message body.
> But there are however only one unit test for this in camel-jms, so
> lets add one to camel-core.
>
> On Fri, Apr 3, 2020 at 11:23 PM Craig Taylor <ctalk...@ctalkobt.net>
> wrote:
> >
> > I'm wanting to accumulate all exchanges matching a correlation expression
> > (id) into a list for a given period of time.  I've looked at the
> > GroupedBodyAggregationStrategy and it returns an Exchange with a body of
> > List<Exchange>'s where I had expect an Exchange with a body of
> > List<Body_type> back.
> >
> > aggregate(simple("${body.id}"), new GroupedBodyAggregationStrategy())
> >     .completionTimeout(5000L)
> >
> > I wasn't able to find documentation on the built-in aggregator however,
> > this "sounds" like the right one to use based on naming.  Desperation
> wise,
> > attempting the other Grouped Aggregators didn't yield the solution
> either.
> >
> > Thanks,
> > --
> > -------------------------------------------
> > Craig Taylor
> > ctalk...@ctalkobt.net
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
-------------------------------------------
Craig Taylor
ctalk...@ctalkobt.net

Reply via email to