1
votes

I'm trying to write a script to query ActiveMQ through the shell (using the activemq-admin query command) to determine what is the maximum size of the queue "to date" (that is, since the server started up).

When I enter the following query:

activemq-admin query -QQueue=MyQueueName

I get the following output:

Java Runtime: Sun Microsystems Inc. 1.6.0_25 /usr/java/jdk1.6.0_25/jre
    Heap sizes: current=91456k  free=90978k  max=1358080k
        JVM args: -Dactivemq.classpath=/usr/local/activemq/conf; -Dactivemq.home=/usr    /local/activemq -Dactivemq.base=/usr/local/activemq
ACTIVEMQ_HOME: /usr/local/activemq
ACTIVEMQ_BASE: /usr/local/activemq
Connecting to pid: 3005
DequeueCount = 5930
Name = MyQueueName
MinEnqueueTime = 0
CursorMemoryUsage = 733711
MaxAuditDepth = 2048
Destination = loadable
AverageEnqueueTime = 0.45332837486054295
InFlightCount = 0
MemoryLimit = 1048576
Type = Queue
EnqueueCount = 8067
MaxEnqueueTime = 79
MemoryUsagePortion = 0.0
ProducerCount = 0
UseCache = true
BlockedProducerWarningInterval = 30000
MaxProducersToAudit = 32
CursorFull = false
BrokerName = localhost
PrioritizedMessages = false
ConsumerCount = 0
ProducerFlowControl = true
Subscriptions = []
QueueSize = 2137
MaxPageSize = 200
CursorPercentUsage = 69
DispatchCount = 620
MemoryPercentUsage = 69
ExpiredCount = 0

When I go to the web console I see 2137 messages queued up in MyQueueName , which corresponds to the QueueSize field in this output.

But at one point (during execution of a Java app) I saw over 3000 messages in this queue.

Does ActiveMQ provide a metric for getting the "global max queue size"? That is, the maximum number of enqueued messages at any point in time?

Thanks in advance!

1

1 Answers

0
votes

Has the broker been stopped/started since then? I just tried my-self and if I stop the broker, the data goes "away" about the queue, which to me sounds like a bug. You should ask on the ActiveMQ forums about this. btw I am using version 5.5.1 which is the latest stable as they say, also this bug is not new at all, look at somehow related AMQ-1367.

Again, your best bet is on ActiveMQ forum :

ActiveMQ forum

Cheers, Eugene.