ExecutorSubscribableChannel consistently rethrows Error as MessageDeliveryException

Issue: SPR-14323
master
Juergen Hoeller 8 years ago
parent fc40643033
commit e4976a2c6d
  1. 6
      spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java
  2. 11
      spring-messaging/src/main/java/org/springframework/messaging/support/ExecutorSubscribableChannel.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -126,9 +126,9 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep
} }
throw new MessageDeliveryException(message,"Failed to send message to " + this, ex); throw new MessageDeliveryException(message,"Failed to send message to " + this, ex);
} }
catch (Error ex) { catch (Error err) {
MessageDeliveryException ex2 = MessageDeliveryException ex2 =
new MessageDeliveryException(message, "Failed to send message to " + this, ex); new MessageDeliveryException(message, "Failed to send message to " + this, err);
chain.triggerAfterSendCompletion(message, this, sent, ex2); chain.triggerAfterSendCompletion(message, this, sent, ex2);
throw ex2; throw ex2;
} }

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -99,7 +99,7 @@ public class ExecutorSubscribableChannel extends AbstractSubscribableChannel {
/** /**
* Invoke a MessageHandler with ExecutorChannelInterceptor's. * Invoke a MessageHandler with ExecutorChannelInterceptors.
*/ */
private class SendTask implements MessageHandlingRunnable { private class SendTask implements MessageHandlingRunnable {
@ -143,10 +143,11 @@ public class ExecutorSubscribableChannel extends AbstractSubscribableChannel {
String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler; String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler;
throw new MessageDeliveryException(message, description, ex); throw new MessageDeliveryException(message, description, ex);
} }
catch (Error ex) { catch (Error err) {
String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler; String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler;
triggerAfterMessageHandled(message, new MessageDeliveryException(message, description, ex)); MessageDeliveryException ex2 = new MessageDeliveryException(message, description, err);
throw ex; triggerAfterMessageHandled(message, ex2);
throw ex2;
} }
} }

Loading…
Cancel
Save