The MessageExchangeTemplate's receiveAndForward() method now throws the original Exception if it is a MessagingException. If it is not a MessagingException, then it will be wrapped within a new MessagingException (INT-325).

This commit is contained in:
Mark Fisher
2008-08-05 15:31:22 +00:00
parent b68fa47fcc
commit 8e1c52b312

View File

@@ -240,8 +240,8 @@ public class MessageExchangeTemplate implements InitializingBean {
return sent;
}
catch (Exception e) {
MessagingException exception = new MessagingException(
"exception occurred in receive-and-forward exchange", e);
MessagingException exception = (e instanceof MessagingException) ? (MessagingException) e
: new MessagingException("exception occurred in receive-and-forward exchange", e);
if (source instanceof MessageDeliveryAware) {
((MessageDeliveryAware) source).onFailure(exception);
}