camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: AggregationStrategy: null body in new exchange
Date Wed, 05 Apr 2017 11:35:48 GMT
Make a simple unit test with your aggregator and agg strategy and get
that working outside osgi/karaf and then take it from there.



On Mon, Apr 3, 2017 at 4:20 PM, JD Innocenti <jd.innocenti@gmail.com> wrote:
> Hi all,
>
> I'm having a problem with the AggregationStrategy I implemented for an
> application. In short, the newExchange parameters I receive (to follow the
> same naming convention as in the  documentation
> <https://camel.apache.org/aggregator.html>  ) always have a null body.
>
> To elaborate: my route is pretty simple. It downloads files from an FTP
> server, transforms then into POJOs, aggregate those into a single POJO,
> which is then marshalled and saved to a file. I'm working with JBoss
> Developer Studio (an Eclipse derivative), and when I test from the IDE, this
> works fine (behind the scenes, the IDE does "mvn clean package
> org.apache.camel:camel-maven-plugin:run").
>
> However, when I build an OSGi bundle of my application (with "mvn clean
> install"), which I then deploy in JBoss Fuse (on Karaf), the deployment is
> successful but my aggregator only receives null-bodied "newExchange" params.
> The correlation expression I use is a simple constant, since all POJOs must
> be aggregated.
>
> I also posted about this issue on  StackOverflow
> <https://stackoverflow.com/questions/43184357/different-behavior-of-apache-camel-aggregation-in-ide-and-when-deployed-in-jboss>
> , in case someone finds this post in the future ;)
>
> Here's what the aggregation looks like in my Camel context:
>
>
>
> And for the sake of completeness, here's the beginning of the aggregator:
>
>
>
> (MyPojoClass is in the same package than the aggregator)
> With the above, once again, everything happens as expected in the IDE, but
> when I deploy my application in Fuse, I get "Nothing to aggregate" all the
> time.
>
> I tried to set a header on all the messages and aggregate on the header
> (instead of the constant I currently use), but the results are the same.
>
> Please help, Camel user mailing list, you're my only hope. :)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/AggregationStrategy-null-body-in-new-exchange-tp5796879.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message