I stumbled across a problem when calling the stop() method on the SimpleMessageListenerContainer instance. The AbstractMessageListenerContainer method doExecuteListener(...) seems to be the core of my poblem:

Code:
	protected void doExecuteListener(Channel channel, Message message) throws Throwable {
		//TODO consider adding support for AcceptMessagesWhileStopping functionality
		if (!isRunning()) {
			if (logger.isWarnEnabled()) {
				logger.warn("Rejecting received message because of the listener container " +
						"having been stopped in the meantime: " + message);
			}
			rollbackIfNecessary(channel);
			throw new MessageRejectedWhileStoppingException();
		}
		try {
			invokeListener(channel, message);
		}
		catch (Throwable ex) {
			rollbackOnExceptionIfNecessary(channel, ex);
			throw ex;
		}				
		commitIfNecessary(channel, message);
	}
If there is some message processed right now, the execution follows this path:

Code:
if (!isRunning()) {
			if (logger.isWarnEnabled()) {
				logger.warn("Rejecting received message because of the listener container " +
						"having been stopped in the meantime: " + message);
			}
			rollbackIfNecessary(channel);
			throw new MessageRejectedWhileStoppingException();
		}
The exception is thrown so the message will never be ACKed and the connection to the relevant queue is stuck even after calling start() on the SimpleMessageListenerContainer. Is there any way to handle this situation?