Reputation: 1250
I'm using hornetq for awhile now and it's been ok until recently. I have a problem like this: i have some messages that are "stuck" in the queue (i am working with in client-acknowledge mode, so the problem may be that some of my consumers are holding the messages and are not sending acknowledgements). I am using JConsole to look at the queue, i can see that the message counter is rising but yet when i try to "listMessagesAsJson" i get an empty result for reference, i tried sending them to dead later queue (transacted mode and throwing RuntimeExceptions on purpose) and in the DLQ i can actually see both the messageCounter and the "listMessagesAsJson" actually DOES work on the DLQ (i'm getting the message list) However, i cannot fathom the difference between the DLQ and my ordinary queue. Can anyone help me out here? Thanks in advance
Upvotes: 2
Views: 981
Reputation: 5383
We have added another method called listDeliveringMessages that may give you the in-flight messages and give you an idea on what's going on.
This was done as part of https://issues.jboss.org/browse/HORNETQ-763
You are currently using 2.2.14 (per our discussion on the hornetq's forum) which doesn't include the fix..
For more details you can refer to this github commit: https://github.com/hornetq/hornetq/commit/3812ee77100c473489f72f36e5078a56d37e5c19
Upvotes: 2
Reputation: 16056
I suspect you are correct about client's not acking the messages. The messages in the queue which have been delivered to consumers, but not yet acknowledged (or TX commited) exist in this grey state where they must be kept in case the client rollsback and the message must be redelivered, but at the same time, they're essentially unavailable to anyone else because they can only be delivered to one consumer. I bet that if you have n messages in your queue, but no active consumers, the listMessagesAsJson operation will list them without issue.
The DLQ works because the runtime exception is terminal and the broker knows the message has been rejected by the consumer so it's not in the "grey" zone.
Upvotes: 1