Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4EEA17529 for ; Wed, 15 Apr 2015 13:47:08 +0000 (UTC) Received: (qmail 24708 invoked by uid 500); 15 Apr 2015 13:46:59 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 24647 invoked by uid 500); 15 Apr 2015 13:46:59 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 24492 invoked by uid 99); 15 Apr 2015 13:46:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2015 13:46:59 +0000 Date: Wed, 15 Apr 2015 13:46:59 +0000 (UTC) From: "Martin Lichtin (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-5726) browse command using a message selector does not work as suggested MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Martin Lichtin created AMQ-5726: ----------------------------------- Summary: browse command using a message selector does not work as suggested Key: AMQ-5726 URL: https://issues.apache.org/jira/browse/AMQ-5726 Project: ActiveMQ Issue Type: Improvement Environment: Karaf 3.0.3 Reporter: Martin Lichtin Priority: Minor browse --help output shows example: browse --amqurl tcp://localhost:61616 --msgsel JMSMessageID='*:10',JMSPriority>5 FOO.BAR however, this causes ERROR: java.lang.RuntimeException: Failed to execute browse task. Reason: javax.jms.InvalidSelectorException: (JMSMessageID=*:10) AND (JMSPriority>5) java.lang.RuntimeException: Failed to execute browse task. Reason: javax.jms.InvalidSelectorException: (JMSMessageID=*:10) AND (JMSPriority>5) at org.apache.activemq.console.command.AmqBrowseCommand.runTask(AmqBrowseCommand.java:155) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.karaf.commands.ActiveMQCommandSupport.doExecute(ActiveMQCommandSupport.java:49) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33) at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39) at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35) at Proxy35b0c9cf_9e26_4170_a928_79953d26389c.execute(Unknown Source) at Proxy35b0c9cf_9e26_4170_a928_79953d26389c.execute(Unknown Source) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:208) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133) at java.security.AccessController.doPrivileged(Native Method) at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129) Error executing command: javax.jms.InvalidSelectorException: (JMSMessageID=*:10) AND (JMSPriority>5) It seems the single quotes get lost by the Karaf shell. One has to use double-quotes around it to make it work. browse --amqurl tcp://localhost:61616 --msgsel "JMSMessageID='*:10',JMSPriority>5" FOO.BAR Best if this could be shown properly in the help output. BTW, AmqBrowseCommand.java, line 156, no new Exception should be created, just throw e. As it stands, the root cause is not displayed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)