activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: AMQ-3404 & querying via JMX
Date Mon, 18 Jul 2011 21:23:21 GMT
On Mon, 2011-07-18 at 14:15 -0700, Allen Reese wrote:
> 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.

The QueueViewMBean has a method "removeMatchingMessages" that takes a
selector, doesn't that do what you want?  If not what is the use case?

Regards
Tim.


-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Mime
View raw message