3.4. activemq:purge, purge

download PDF


purges messages from a destination


activemq:purge [ --msgsel { msgsel ...} ] [ --pid PID ] [ --jmxurl JMXUrl ] [ -jmxuser userName ] [ -jmxpassword password ] [ -jmxlocal ] [ --version ] [[ --help ] | [ -h ] | [ -? ]] { destName }


Table 3.5, “activemq:purge Arguments” describes the command's arguments.
Table 3.5. activemq:purge Arguments
--msgsel msgsel1,msgsel2,...Purges messages matched by the message selector. See the section called “Message filters”.
--jmxurl URL Sets the JMX URL used to locate the broker.
--pid PID Set the pid to connect to (only on Sun JVM).
--jmxuser user Sets the JMX user, used for authentication.
--jmxpassword password Sets the JMX password, used for authentication.
--jmxlocal Specifies to use the local JMX server instead of a remote server
--version Displays the version information
-h, -?, --help Displays the online help for this command
destName The specified message destination(s)


The following command purges all the messages in the queue TEST.FOO on a broker:
JBossA-MQ:karaf@root>activemq:purge TEST.FOO
The following command purges any messages with an ID ending in 10:
JBossA-MQ:karaf@root>activemq:purge --msgsel JMSMessaageID='*:10' TEST.FOO
The following command purges messages with a priority of 3, enter:
JBossA-MQ:karaf@root>activemq:purge --msgsel JMSPriority=3 TEST.FOO
The message selectors from the preceding two examples can be combined as follows:
JBossA-MQ:karaf@root>activemq:purge --msgsel JMSMessaageID='*:10',JMSPriority=3 TEST.FOO
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.