HornetQ pending messages

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.1.2
  • HornetQ
    • 2.2.x

Issue

  • The messages were still stuck in the topic even after the messages were consumed by the durable subscribers.

Resolution

  • The client was creating transacted session using the following code without acknowledging after the message was consumed.
 TopicSession topicSessionPublish = topicConnPublish.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE)
  • You either need to acknowledge the message from the client by calling
message.acknowledge();
  • Or by letting the acknowldgement be handled by the container using the following code:
 TopicSession topicSessionPublish = topicConnPublish.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.