Hi All,
I'm getting to grips with Spring Integration 2.1.0.RC1. After reading the reference manual and looking at some examples, I'm still a little bit confused on how to best handle an application exception that I throw. I would welcome some advice please. Below are snippets of my configuration:
Here is myServiceActivator:Code:<int:exception-type-router input-channel="myServiceActivator" default-output-channel="myErrorChannel"> <int:mapping exception-type="bar.foo.MyException" /> </int:exception-type-router> <int:channel id="myErrorChannel"/>
Let's pretend that the doSomething throws a MyException. Does this configuration outlined above seem appropriate to handle the Exception (am I missing a trick?)Code:@ServiceActivator(inputChannel = "myServiceActivator") public void processMessage(final Message<String> message) throws MyException { final String payload = message.getPayload(); myBean.doSomething(payload); }
I ask this to help answer another question. I'm hooking up the myErrorChannel to a RabbitMQ exchange, i.e.,
When the exception gets thrown (assuming my configuration above looks reasonable and I'm not missing a trick on how to *properly* configure spring integration to handle exceptions) I notice in the Queue in Rabbit I have an appropriate message in my Error Queue - but the thing is I only see the payload of the message that arrived from RabbitMQ into Spring Integration and *not* the details of MyException (I would have expected perhaps a stack trace to be the payload that gets sent to RabbitMQ on an error.)Code:<int-amqp:outbound-channel-adapter channel="myErrorChannel" exchange-name="amq.direct" routing-key="myErrorQueueRoutingKey" />
I would be extremely grateful on some feedback on this issue.
Thank you so much in advance.
-=bootlaces=-


Reply With Quote
