activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <>
Subject Is 'query' broken in RC3?
Date Tue, 02 May 2006 02:19:55 GMT
I've been trying really hard to figure out the right combination of  
flags to pass to query to get it to produce anything meaningful...  
with not much luck.

I've got my broker listening for JMX on a different port, so I have  
to pass it --jmxurl service:<cut> (and not I did not actually pass it  
<cut>, but a valid string... just adding it here to show that I must  
always pass this in).

Lets say I want to display all of the Queue's, this is what I am lead  
to believe by the docs is the right flags:

     ./query --jmxurl service:<cut> -QQueue=*

This spits out:


And then exists.  Not very useful.  If I run with no flags (other  
than the --jmxurl) I get a ton of stufff, one of them being:

Type = Queue
Destination = BUILD.TASKS
QueueSize = 1022
DequeueCount = 8467
MemoryPercentageUsed = 0
ConsumerCount = 22
MemoryLimit = 9223372036854775807
EnqueueCount = 1475
BrokerName = localhost

So, why doesn't this Queue show up when I say -QQueue=*?  If I  
specify the full name it does not work either:

     ./query --jmxurl service:<cut> -QQueue=BUILD.TASKS

I'm not sure that -xQ works either, since this:

     ./query --jmxurl service:<cut> -xQTopic=ActiveMQ.Advisory.*

Spits out stuff that includes:

Type = Topic
Destination = ActiveMQ.Advisory.Producer.Topic.BUILD.PING
QueueSize = 0
DequeueCount = 0
MemoryPercentageUsed = 0
ConsumerCount = 0
MemoryLimit = 9223372036854775807
EnqueueCount = 27
BrokerName = localhost

Seems like the -xQ and -Q stuff just does not work.  --objname seems  
to work better.  For example, to list all Queue's:

     ./query --jmxurl service:<cut>  --objname Type=Queue

This actually does what I expect.  So does:

     ./query --jmxurl service:<cut> --objname  

Furthermore, query does not parse its command line options very  
well.  It should allow long options with values to be defined as -- 
opt=value or --opt value, but it does not support the first, but it  
will recognice that you are trying to use the --opt flag.  For example:

     ./query --jmxurl service:<cut> --objname Type=Topic -- 

This will complain with:

     ERROR: java.lang.IllegalArgumentException: Object name query not  

But this works...

         ./query --jmxurl service:<cut> --objname Type=Topic -- 
xobjname=Destination=ActiveMQ.Advisory.* Destination=ActiveMQ.Advisory.*

And it does the right thing... which seems quite insane to me.

I would also recommend that if an option parsing or handing error  
occurs to just exit... since chances are the output is not going to  
be what the user wanted.  Currently, the above ERROR continued to  
spit out all Topics (including all ActiveMQ.Advisory.* stuff) which  
is not what I wanted.

I highly recommending using Commons CLI 
commons/cli (or something similar) to get consistent posix-style  
command line argument parsing.

  * * *

Is anyone actively testing these admin features for the 4.0 release?   
So far I have not had much luck with any of them to get useful stuff  
that a sysadmin might want to see.

I did play with `browse` a little, and noticed that it just caused a  
bunch of exceptions to be thrown on the server-side.


This email and any attachment(s) thereto, are intended for the use of
the addressee(s) named herein and may contain legally privileged and or
confidential information under applicable law. If you are not the
intended recipient of this e-mail, you are hereby notified any
dissemination, distribution or copying of this email, and any attachment(s)
thereto, is strictly prohibited. If you have received this communication
in error, please notify the sender at 415-281-2200 or via return e-mail at and permanently delete the original copy and 
any copy of any e-mail, and any printout thereof. Thank you for your 

View raw message