[jboss-user] [JBoss Messaging] - Negative MessageCount

Noa Drach do-not-reply at jboss.com
Wed Aug 18 09:46:11 EDT 2010

Noa Drach [http://community.jboss.org/people/newway] created the discussion

"Negative MessageCount"

To view the discussion, visit: http://community.jboss.org/message/557928#557928

We have a part in my code that queries a queue once in an hour to get it's size.

this is the code e used

MBeanServer mBeanServer = MBeanServerLocator.locateJBoss();
ObjectName serverObjectName = new ObjectName("jboss.messaging.destination:service=Queue,name=" + queueName);
Integer messagesInQueue = (Integer) mBeanServer.getAttribute(serverObjectName, "MessageCount");
return messagesInQueue.intValue() ;

and we keep the data in the DB.

from looking into the data kept we see that sometimes we receive negative values.

in  https://jira.jboss.org/browse/JBMESSAGING-926?focusedCommentId=12356514&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel https://jira.jboss.org/browse/JBMESSAGING-926?focusedCommentId=12356514&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel We saw a discussion about this issue but it describes a scenario of calling removeAllMessage. In our case we don't interfere with the queues work messages are sent by the producer and handled by the receivers.

we are using Messaging 1.4.5.GA

I have 2 questions:
1.  Is there an explanation for the negative values?
2. Can We trust the values given when they aren't negative?



Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100818/7871af04/attachment.html 

More information about the jboss-user mailing list