activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Reese <are...@yahoo-inc.com>
Subject RE: AMQ-3404 & querying via JMX
Date Mon, 18 Jul 2011 21:22:17 GMT
Nevermind, I just had to look closer.

I found this in BrowseCommand.java:

// Iterate through the queue result
for (Iterator j = queueList.iterator(); j.hasNext();) {
    List messages = JmxMBeansUtil.createMessageQueryFilter(createJmxConnection(), ((ObjectInstance)j.next()).getObjectName()).query(queryAddObjects);
     context.printMessage(JmxMBeansUtil.filterMessagesView(messages, groupViews, queryViews));
}


Allen Reese
Core Platforms
Yahoo! Inc.

> -----Original Message-----
> From: Allen Reese [mailto:areese@yahoo-inc.com]
> Sent: Monday, July 18, 2011 2:15 PM
> To: dev@activemq.apache.org
> Subject: AMQ-3404 & querying via JMX
> 
> 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);
> 	messages.removeAll(subMsgs);
> }
> 
> 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.

Mime
View raw message