mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4237 - new jmx and list and purge commands
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1430862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8ab1c8d551
commit
881c1b7005
|
@ -57,7 +57,7 @@ public class ListCommand extends AbstractJmxCommand {
|
|||
protected void runTask(List tokens) throws Exception {
|
||||
try {
|
||||
Set<String> propsView = new HashSet<String>();
|
||||
propsView.add("BrokerName");
|
||||
propsView.add("brokerName");
|
||||
context.printMBean(JmxMBeansUtil.filterMBeansView(JmxMBeansUtil.getAllBrokers(createJmxConnection()), propsView));
|
||||
} catch (Exception e) {
|
||||
context.printException(new RuntimeException("Failed to execute list task. Reason: " + e));
|
||||
|
|
|
@ -96,7 +96,7 @@ public class PurgeCommand extends AbstractJmxCommand {
|
|||
|
||||
// Iterate through the queue names
|
||||
for (Iterator<String> i = tokens.iterator(); i.hasNext();) {
|
||||
List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "Type=Queue,Destination=" + i.next() + ",*");
|
||||
List queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "destinationType=Queue,destinationName=" + i.next() + ",*");
|
||||
|
||||
for (Iterator j = queueList.iterator(); j.hasNext();) {
|
||||
ObjectName queueName = ((ObjectInstance)j.next()).getObjectName();
|
||||
|
@ -150,7 +150,7 @@ public class PurgeCommand extends AbstractJmxCommand {
|
|||
* @throws Exception
|
||||
*/
|
||||
public void purgeQueue(ObjectName queue) throws Exception {
|
||||
context.printInfo("Purging all messages in queue: " + queue.getKeyProperty("Destination"));
|
||||
context.printInfo("Purging all messages in queue: " + queue.getKeyProperty("destinationName"));
|
||||
createJmxConnection().invoke(queue, "purge", new Object[] {}, new String[] {});
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ public class MBeansObjectNameQueryFilter extends AbstractQueryFilter {
|
|||
if (pos >= 0) {
|
||||
val = key.substring(pos + 1);
|
||||
key = key.substring(0, pos);
|
||||
} else {
|
||||
objNameQuery += delimiter + key;
|
||||
}
|
||||
|
||||
if (val.startsWith(QUERY_EXP_PREFIX)) {
|
||||
|
|
Loading…
Reference in New Issue