Browse Source
This commit avoids throwing JMSException from the listener execution as this is not allowed per spec. Our SessionAwareMessageListener gives a callback that can throw JMSException and we have "abused" it so far. Typical message processing goes in those 3 steps: * Unmarshall the javax.jms.Message to the requested type * Invoke the actual user method (including processing of method arguments) * Send a reply message, if any Those three steps have been harmonized so that they don't throw a JMSException anymore. For the later case, introduced ReplyFailureException as a general exception indicating the reply message could not have been sent. Issue: SPR-11778pull/493/head
6 changed files with 146 additions and 41 deletions
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
/* |
||||
* Copyright 2002-2014 the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.jms.listener.adapter; |
||||
|
||||
import org.springframework.jms.JmsException; |
||||
|
||||
/** |
||||
* Exception to be thrown when the reply of a message failed to be sent. |
||||
* |
||||
* @author Stephane Nicoll |
||||
* @since 4.1 |
||||
*/ |
||||
@SuppressWarnings("serial") |
||||
public class ReplyFailureException extends JmsException { |
||||
|
||||
public ReplyFailureException(String msg, Throwable cause) { |
||||
super(msg, cause); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue