Announcement Announcement Module
Collapse
No announcement yet.
Un-ACKed messages problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Un-ACKed messages problem

    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?

  • #2
    Could you please open an issue and link it to this forum post?

    This is the Spring AMQP issue tracker:
    https://jira.springsource.org/browse/AMQP

    We're in the process of developing the 2nd milestone, and these are the types of things we're trying to address.

    Thanks,
    Mark

    Comment

    Working...
    X