It can be because the message body from REST is streaming based
http://camel.apache.org/why-is-my-message-body-empty.html

And also you send to seda and don't wait, hence the REST consumer may
close the stream before the aggregator is aggregating the newExchange.

So you should likely convert the message to a non stream to be more
safe such as byte[] or String before routing to seda



On Tue, May 16, 2017 at 7:08 AM, codentravel <shivaprashan...@gmail.com> wrote:
> Hi,
>
> In my aggregationstratgy route, sometimes (1 out of 10000) i get message
> body as null in the newExchange.. I have no clue whats wrong.
>
> Thought of trying the retry with default error handler. But Aggregator
> doesn't support throwing an exception. Is there any alternative to
> aggregator ?
>
>  restConfiguration().component("restlet")
>                     .componentProperty("maxQueued", "-1")
>                     .componentProperty("persistingConnections", "true")
>                     .componentProperty("pipeliningConnections", "true")
>
> .host("localhost").port(Constants.ROUTINGPORT).bindingMode(RestBindingMode.off);
>
>             rest("api/v1").
>                     post("/collector").
>                     consumes("application/octet-stream").
>                     route().routeId("Collector Inlet").
>                     to("seda:aggregate?waitForTaskToComplete=Never");
>
>             from("seda:aggregate").
>                     routeId("Message Aggregation").
>                     setHeader("id", constant("n/a")).
>                     aggregate(header("id"), new MessageAggregation()).
>                     completionSize(Constants.BATCHSIZE).
>                     to("seda:process?waitForTaskToComplete=Never");
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Redelivery-of-message-in-case-of-exception-inside-aggregator-tp5799551.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

Reply via email to