此内容没有您所选择的语言版本。

Chapter 3. ActiveMQ Console Commands


The activemq commands allow you to view and manage the brokers and messages.
Type activemq: then press Tab at the prompt to view the available commands.

3.1. activemq:browse, browse

Abstract

displays messages on a specified destination

Synopsis

activemq:browse { --amqurl brokerURL } [ --msgsel { msgsel ...} ] [ --factory className ] [ --passwordFactory className ] [ --user username ] [ --password password ] [ --view { attr ...} ] [[ -Vheader ] | [ -Vcustom ] | [ -Vbody ]] [ --version ] [[ --help ] | [ -h ] | [ -? ]] destName

Arguments

Table 3.1, “activemq:browse Arguments” describes the command's arguments.
Table 3.1. activemq:browse Arguments
ArgumentInterpretation
--amqurl brokerURL Specifies the URL of the broker to which you are connecting.
--msgsel msgsel1,msgsel2,...Displays messages matched by the message selector.
--factory classNameLoad className as the javax.jms.ConnectionFactory to use for creating connections.
--passwordFactory classNameLoad className as the org.apache.activemq.console.command.PasswordFactory for retrieving the password from a keystore.
--user usernameUsername to use for JMS connections.
--password passwordPassword to use for JMS connections.
-Vheader Shows all the standard JMS message headers.
-VcustomShows all the custom fields added to each JMS message.
-VbodyShows the body of the message.
--view attr1,attr1,... Selects the specific attribute of the message to view.
--versionDisplays the version information.
-h, -?, --helpDisplays the online help for this command.

Message filters

Message filters specified using the --msgsel option take the form header=value. Table 3.2, “Message Headers for Filtering” lists the headers you can use to filter messages.
Table 3.2. Message Headers for Filtering
NameType
JMSCorrelationIDString
JMSDeliveryMode1-Non-Persistent, 2-Persistent
JMSDestinationjavax.jms.Destination
JMSExpirationlong
JMSMessageIDString
JMSPriorityint
JMSRedelivered boolean
JMSReplyTojavax.jms.Destination
JMSTimestamplong
JMSTypeString

Examples

The following command prints the JMS message header, custom message header, and message body of all the messages in the queue TEST.FOO on a broker:
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 TEST.FOO
The following command displays the attributes from the body of the messages in the TEST.FOO queue:
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 -Vbody TEST.FOO
The following command displays any messages with an ID ending in 10:
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10' TEST.FOO
The following command displays messages with a priority of 3, enter:
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSPriority=3 TEST.FOO
The message selectors from the preceding two examples can be combined as follows:
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10',JMSPriority=3 TEST.FOO
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.