Jonathan Hagen
Jonathan Hagen

Reputation: 732

What does it mean by "pending messages" and what is possible cause for ActiveMQ?

I have a project that consumes messages from activeMQ. It runs fine but sometimes it gets pending messages stuck in the queue. It says 1000 enqueued, 0 dequeued, 1000 dispatched. It also says 1000 pending messages.

What could be the possible cause of "Pending Messages"?

Upvotes: 2

Views: 3933

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 34998

"Pending Messages" are messages on the queue which have not been acknowledged by a client. This is sometimes referred to as the "Message Count" of the queue or the "Depth" of the queue.

The most likely cause of an unchanging "pending message" count is that the consumer has failed somehow. It could be stuck in some other kind of blocking network operation or it could be offline completely.

Take a look at the consumer count on the queue. If it's > 0 then consumers are still connected. At that point you should inspect the individual consumers. Assuming the clients are Java-based, thread dumps are good to gather in this kind of situation as that will give you a clear picture of what the client is doing. If the consumer count is 0 then you'll need to reattach your consumers.

Upvotes: 1

Related Questions