On Mon, Aug 20, 2012 at 7:43 AM, Neeraj Mahajan
<neeraj.maha...@specsavers.com> wrote:
> Thanks Claus for your quick reply.
> The exception is not coming while doing the aggragation, Actually exception
> is coming once my aggregation is complete and aggregation component sends
> the aggregated response to the *next direct route*, which actually throws
> the exception. Once aggregated mesage is send to the next route, I believe
> the *aggregation stratergy does not play* any role, so can't handled my
> exception there.
>

Ah yeah that was the old behavior in Camel 1.x. And one of the reasons
why we re-wrote the aggregator in Camel 2.x onwards.
In 2.x it aggregates on-the-fly, where as in 1.x it does that in a
batch when complete.


> Following is the stack trace of the exception I am getting
> ERROR - Aggregator                     - Response Genereration Exception
> com.transition.ResponseGenerationException: Response Genereration Exception
>         at
> com.transition.processors.ResponseGenerationProcessor.process(ResponseGenerationProcessor.java:67)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:70)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
>         at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:47)
>         at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:69)
>         at
> org.apache.camel.processor.BatchProcessor.processExchange(BatchProcessor.java:151)
>         at
> org.apache.camel.processor.BatchProcessor$BatchSender.sendExchanges(BatchProcessor.java:293)
>         at
> org.apache.camel.processor.BatchProcessor$BatchSender.run(BatchProcessor.java:238)
>
>
> The solution I am thinking is to override the handleException method of the
> Error handler which aggregator uses by default(I check the api when
> org.apache.camel.processor.BatchProcessor$BatchSender.sendExchanges(BatchProcessor.java:293)
> method is called, the catch block calls the handleException method which
> actually handle the aggregator exception). But I am not able to find, how I
> can set the error handler for my aggregator component.
>
> Please suggest if this can be done, or if there is some better solution to
> resolve the issue.
>
> Thanks
> Neeraj Mahajan
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629p5717676.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to