You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by TonyK <ak...@sfgmembers.com> on 2013/04/27 00:13:16 UTC
Re: Exception in second inOut jms endpoint returns null body to
aggregation strategy
I've trimmed my code to the bear minimum. If I throw the exception in my
first call to the child route, then I get the body returned to my
aggregation strategy, but when I throw an exception on my second call the
body is null when I get to the aggregation strategy. Why would this be?
--------------------------------------------------------------------
Main Route
--------------------------------------------------------------------
<camelContext xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="defaultHandler">
<errorHandler id="defaultHandler" type="DeadLetterChannel"
deadLetterUri="smtp://localhost:8059?to=mrr@aaaa.com&subject=Complete" />
<route id="REMOVETestEnvironmentWriteToQueue">
<from uri="{{endpoint.IncomingRequest}}" />
<to uri="jms:ANN.NB.ILLUST.BATCH" />
</route>
<route id="IllustrationsBatch">
<from uri="jms:ANN.NB.ILLUST.BATCH" />
<camel:split strategyRef="IllustAggregationStrat"
parallelProcessing="false">
<xpath>/TXLife/TXLifeRequest</xpath>
*If I throw an exception on the first call to the child route, then my error
handler will send me an email with the body of "Test" and when I reach my
aggregation strategy the body also says "Test". Which is what I would
expect.*
<transform><camel:simple>Test</camel:simple></transform>
<inOut
uri="jms:ANN.NB.ILLUST.IMAGE.IN?transferException=true&requestTimeout=120000"
/>
*If I throw an exception on the second call to the child route, then my
error handler will send me an email with the body of "Test2", but when I
reach my aggregation strategy the body is null.*
<transform><camel:simple>Test2</camel:simple></transform>
<inOut
uri="jms:ANN.NB.ILLUST.IMAGE.IN?transferException=true&requestTimeout=120000"
/>
</camel:split>
</route>
</camelContext>
--------------------------------------------------------------------------------------
Child route
--------------------------------------------------------------------------------------
<camelContext xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="defaultHandler">
<errorHandler id="defaultHandler" type="NoErrorHandler" />
<route id="ImagingRoute">
<from
uri="jms:ANN.NB.ILLUST.IMAGE.IN?transferException=true&requestTimeout=120000"
/>
<to uri="bean:fakeImageCall" />
</route>
</camelContext>
------------------------------------------------------------------------------------------------------
Bean
----------------------------------------------------------------------------------------------
public class ImageServiceCall {
public void process(Exchange exchange) throws Exception {
if(exchange.getIn().getBody(String.class).equals("Test2")){
throw new IOException();
}
}
}
--
View this message in context: http://camel.465427.n5.nabble.com/Null-Body-tp5731568p5731637.html
Sent from the Camel - Users mailing list archive at Nabble.com.