INT-2704 Exception Processing in TCP Adapter
When using an outbound adapter with a server connection factory (an inbound adapter 'owns' the connections), the outbound adapter simply logged exceptions. There are use cases where flows need to know the exception occurs. Change the adapter to throw a MessagingException. Update the 2.1 to 2.2. Migration guide explaining that the ExpressionEvaluatingRequestHandlerAdvice can be used to restore 2.1 behavior, and trap the exception.
This commit is contained in:
committed by
Oleg Zhurakousky
parent
3feef9414a
commit
89d2f3ad83
@@ -134,15 +134,17 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan
|
||||
protected Object doInvoke(ExecutionCallback callback, Object target, Message<?> message) throws Exception {
|
||||
try {
|
||||
Object result = callback.execute();
|
||||
if (onSuccessMessageProcessor != null) {
|
||||
if (this.onSuccessMessageProcessor != null) {
|
||||
evaluateExpression(message, this.onSuccessMessageProcessor, this.successChannel, this.propagateOnSuccessEvaluationFailures);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (Exception e) {
|
||||
Object evalResult = evaluateExpression(message, this.onFailureMessageProcessor, this.failureChannel, false);
|
||||
if (this.returnFailureExpressionResult) {
|
||||
return evalResult;
|
||||
if (this.onFailureMessageProcessor != null) {
|
||||
Object evalResult = evaluateExpression(message, this.onFailureMessageProcessor, this.failureChannel, false);
|
||||
if (this.returnFailureExpressionResult) {
|
||||
return evalResult;
|
||||
}
|
||||
}
|
||||
if (!this.trapException) {
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user