Description
When using a durable topics the Pending Queue Counter provides an incorrect value for pending messages.
Steps to recreate
Set up the durable subscriber
ant consumer -Durl=tcp://localhost:61616 -Dtopic=true -Dsubject=MYSUB -Ddurable=true -Dmax=2
Stop the subscriber
Send 20 persistent messages
ant producer -Ddurable=true -Durl=tcp://localhost:61616 -Dtopic=true -Dsubject=MYSUB -Dmax=20
Consume 2 messages
ant consumer -Durl=tcp://localhost:61616 -Dtopic=true -Dsubject=MYSUB -Ddurable=true -Dmax=2
View the counter stats.
The result is the following:
Pending Queue Size = 38 Dispatched Queue Size = 0 Dispatched Counter = 20 Enqueue Counter = 20 Dequeue Counter = 2