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)