activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Reese <>
Subject AMQ-3404 & querying via JMX
Date Mon, 18 Jul 2011 21:15:14 GMT
I'm looking at the patch we have put together for AMQ-3404 (Fix the Purge command to use message
selectors), and I've run into something that just doesn't seem right.

In order to create the list of messages to remove, an AmqMessagesQueryFilter is created, and
this requires a broker URL.  However, the rest of the purge command is done using JMX commands.

The added code is something like this:
// apply additive operations.
List messages = AmqMessagesUtil.getMessages(getBrokerUrl(), dest, queryAddObjects);
context.printInfo("Messages are: "+ messages.toString());

// apply subtraction operations
if (querySubObjects.size() > 0) {
	List subMsgs = AmqMessagesUtil.getMessages(getBrokerUrl(), dest, querySubObjects);

purgeMessages(queueName, messages);

Is there any way to do the query over JMX instead of creating a JMS connection to the broker?
I'm hesitant to send in a patch that adds what feels like an extreme hack.

Allen Reese
Core Platforms
Yahoo! Inc.

View raw message