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 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:
- Is there an explanation for the negative values?
- Can We trust the values given when they aren't negative?
Thanks,
Noa