Announcement Announcement Module
Collapse
No announcement yet.
CLIENT_ACKNOWLEDGE not working with DefaultMessageListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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...

    Comment

    Working...
    X