[
https://issues.apache.org/jira/browse/AMQ-3472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14323912#comment-14323912
]
metatech commented on AMQ-3472:
-------------------------------
A workaround in 5.7 is to replace the following line in method "purge" of class
"org.apache.activemq.broker.region.Queue"
- this.destinationStatistics.getMessages().setCount(0);
+
this.destinationStatistics.getMessages().setCount(this.destinationStatistics.getInflight().getCount());
AMQ-4598 included in ActiveMQ 5.8 probably has a real fix.
> Negative number of pending messages in broker
> ---------------------------------------------
>
> Key: AMQ-3472
> URL: https://issues.apache.org/jira/browse/AMQ-3472
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Affects Versions: 5.5.0
> Environment: RHEL 5.5, Sun Java 1.6.0_21, Tomcat 6, Synchronous
> message consumers, 10k messages per consumer prefetch, 2-10 million messages
> a day, in-container broker.
> Reporter: Marcin Depinski
>
> After the purge and deletion of a queue and a restart of the broker, the
> broker shows a negative number of pending messages. Similar to AMQ-1693. Seen
> this at least a dozen times in our environment. Another restart with no
> messages pending and no consumers will zero the counter correctly but we
> can't be restarting our app every time this happens. Things still seem to
> work after the counter goes negative but if anything inside ActiveMQ is
> counting on this counter being correct well... let me know if I can help
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)