-
1. Re: camel components - success in first run, exception in second run
davsclaus Apr 27, 2011 5:38 PM (in response to labo32_delaboe)You have a NPE exception in your source code. Check this code line
TeamAggregationStrategy.java:42
-
2. Re: camel components - success in first run, exception in second run
labo32_delaboe Apr 28, 2011 12:14 AM (in response to davsclaus)Line 42 is
String resourceResponse = resource.getIn().getBody(String.class);
of the code
public class TeamAggregationStrategy implements AggregationStrategy {
public Exchange aggregate(Exchange original, Exchange resource) {
String originalBody = original.getIn().getBody(String.class);
String resourceResponse = resource.getIn().getBody(String.class);
Since the resource is in the configured directory
and the code is running correct during the fisrt run I am a little bit confused.
Edited by: labo32 on Apr 28, 2011 4:14 AM
-
3. Re: camel components - success in first run, exception in second run
davsclaus Apr 28, 2011 1:39 AM (in response to labo32_delaboe)The resource exchange is null if pollEnrich cannot retrieve any data.
Its explained a bit here
http://camel.apache.org/content-enricher.html
And chapter 3 in the Camel in Action book covers this in much more details.
So I suggest to adjust your code and check for resource could be null.
-
4. Re: camel components - success in first run, exception in second run
labo32_delaboe Apr 28, 2011 5:28 AM (in response to davsclaus)I will check this.
But there is still the question why the poll enrich ist not able to retrieve data during the second run since the file is in the configured directory. Is there a mechanism that the poll enrich reads the (static file) only one time if the file has the same timestamp ?
My intention is to read with the poll enrich some static xml (body of a webservice call)
and add some values read from the jms topic and merge these two to the final input of an external webservice.
-
5. Re: camel components - success in first run, exception in second run
davsclaus Apr 28, 2011 11:34 AM (in response to labo32_delaboe)If you want to poll the same file repeatedly then you need to set idempotent=false, on the pollEnrich uri, so the file consumer will be able to poll the file again.
-
6. Re: camel components - success in first run, exception in second run
labo32_delaboe Apr 28, 2011 1:55 PM (in response to davsclaus)The idempotent=false flag solved the problem.
Thanks a lot