Results 1 to 2 of 2

Thread: Un-ACKed messages problem

  1. #1
    Join Date
    Nov 2007
    Posts
    7

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •