Negative score on pending ActiveMQ message

I am tracking ActiveMQ using jmx. I am using the below link to get the ActiveMQ summary

http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost/BrokerId,TotalEnqueueCount,TotalDequeueCount,TotalConsumerCount,TotalMessageCount,TotalConnectionsCount,TotalConsumerCount,TotalProducerCount,MemoryLimit,MemoryPercentUsage,StoreLimit,StorePercentUsage

      

At time T1

I am posting 100 message to ActiveMQ, but I haven't deleted any message. Now the summary will look like below

{
    "timestamp" : 1437996108,
    "status" : 200,
    "request" : {
        "mbean" : "org.apache.activemq:brokerName=localhost,type=Broker",
        "attribute" : ["BrokerId", "TotalEnqueueCount", "TotalDequeueCount", "TotalConsumerCount", "TotalMessageCount", "TotalConnectionsCount", "TotalConsumerCount", "TotalProducerCount", "MemoryLimit", "MemoryPercentUsage", "StoreLimit", "StorePercentUsage"],
        "type" : "read"
    },
    "value" : {
        "BrokerId" : "ID:synclap5489-54676-1437995895016-0:1",
        "TotalConnectionsCount" : 100,
        "TotalDequeueCount" : 0,
        "StoreLimit" : 104857600,
        "TotalConsumerCount" : 0,
        "TotalMessageCount" : 100,
        "TotalProducerCount" : 0,
        "MemoryPercentUsage" : 0,
        "StorePercentUsage" : 9,
        "TotalEnqueueCount" : 100,
        "MemoryLimit" : 739717939
    }
}

      

And stopped the ActiveMQ server in this way with 100 pending messages.

At time T2

Launched ActiveMQ again and sent 100 more messages, but didn't reject any message. Now the Json data looks like below

{
    "timestamp" : 1437996721,
    "status" : 200,
    "request" : {
        "mbean" : "org.apache.activemq:brokerName=localhost,type=Broker",
        "attribute" : ["BrokerId", "TotalEnqueueCount", "TotalDequeueCount", "TotalConsumerCount", "TotalMessageCount", "TotalConnectionsCount", "TotalConsumerCount", "TotalProducerCount", "MemoryLimit", "MemoryPercentUsage", "StoreLimit", "StorePercentUsage"],
        "type" : "read"
    },
    "value" : {
        "BrokerId" : "ID:synclap5489-55183-1437996657303-0:1",
        "TotalConnectionsCount" : 100,
        "TotalDequeueCount" : 0,
        "StoreLimit" : 104857600,
        "TotalConsumerCount" : 0,
        "TotalMessageCount" : 100,
        "TotalProducerCount" : 0,
        "MemoryPercentUsage" : 0,
        "StorePercentUsage" : 9,
        "TotalEnqueueCount" : 100,
        "MemoryLimit" : 739717939
    }
}

      

After Deque

After deleting all messages, I get json data like below

{
    "timestamp" : 1437997015,
    "status" : 200,
    "request" : {
        "mbean" : "org.apache.activemq:brokerName=localhost,type=Broker",
        "attribute" : ["BrokerId", "TotalEnqueueCount", "TotalDequeueCount", "TotalConsumerCount", "TotalMessageCount", "TotalConnectionsCount", "TotalConsumerCount", "TotalProducerCount", "MemoryLimit", "MemoryPercentUsage", "StoreLimit", "StorePercentUsage"],
        "type" : "read"
    },
    "value" : {
        "BrokerId" : "ID:synclap5489-55183-1437996657303-0:1",
        "TotalConnectionsCount" : 101,
        "TotalDequeueCount" : 200,
        "StoreLimit" : 104857600,
        "TotalConsumerCount" : 1,
        "TotalMessageCount" : -100,
        "TotalProducerCount" : 0,
        "MemoryPercentUsage" : 0,
        "StorePercentUsage" : 9,
        "TotalEnqueueCount" : 100,
        "MemoryLimit" : 739717939
    }
}

      

Changes to TotalDequeueCount to 200 TotalEnqueueCount remain 100 changes to TotalMessageCount -100.

My question is:

Why am I getting a negative value in TotalMessageCount?

Why does this only happen when the broker has been restarted with a pending message?

How do I resolve this?

+3


source to share





All Articles