Results 1 to 2 of 2

Thread: CLIENT_ACKNOWLEDGE not working with DefaultMessageListener

  1. #1
    Join Date
    Nov 2008
    Posts
    232

    Default CLIENT_ACKNOWLEDGE not working with DefaultMessageListener

    Hi,
    I am trying to acknowledge the message in my MessageListener implementation by making a call to jmsMessage.acknowledge() but even before this call happens the message is removed from Queue

    Setting:
    ActiveMQ 5.4.2
    Spring 3.0.0

    Code:
    <jms:listener-container connection-factory="receiverConnectionFactory" acknowledge="client" >
        	<jms:listener destination="${queue}" ref="jmsMessageListener" />
        </jms:listener-container>
    Regards,
    Vishal

  2. #2
    Join Date
    Dec 2008
    Posts
    11

    Default

    According to Spring Javadoc :

    * "sessionAcknowledgeMode" set to "AUTO_ACKNOWLEDGE" (default): Automatic message acknowledgment before listener execution; no redelivery in case of exception thrown.
    * "sessionAcknowledgeMode" set to "CLIENT_ACKNOWLEDGE": Automatic message acknowledgment after successful listener execution; no redelivery in case of exception thrown.
    * "sessionAcknowledgeMode" set to "DUPS_OK_ACKNOWLEDGE": Lazy message acknowledgment during or after listener execution; potential redelivery in case of exception thrown.
    * "sessionTransacted" set to "true": Transactional acknowledgment after successful listener execution; guaranteed redelivery in case of exception thrown.


    I think the reason why the message disappears from the queue as soon as you read it is to avoid duplicate read of the same message. I *think* it can be returned if it doesn't get acknowledged...

Posting Permissions

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