이 콘텐츠는 선택한 언어로 제공되지 않습니다.
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.
Argument | Interpretation |
---|---|
--amqurl brokerURL | Specifies the URL of the broker to which you are connecting. |
--msgsel msgsel1,msgsel2,... | Displays messages matched by the message selector. |
--factory className | Load className as the javax.jms.ConnectionFactory to use for creating connections. |
--passwordFactory className | Load className as the org.apache.activemq.console.command.PasswordFactory for retrieving the password from a keystore. |
--user username | Username to use for JMS connections. |
--password password | Password to use for JMS connections. |
-Vheader | Shows all the standard JMS message headers. |
-Vcustom | Shows all the custom fields added to each JMS message. |
-Vbody | Shows the body of the message. |
--view attr1,attr1,... | Selects the specific attribute of the message to view. |
--version | Displays the version information. |
-h, -?, --help | Displays 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.
Name | Type |
---|---|
JMSCorrelationID | String |
JMSDeliveryMode | 1 -Non-Persistent, 2 -Persistent |
JMSDestination | javax.jms.Destination |
JMSExpiration | long |
JMSMessageID | String |
JMSPriority | int |
JMSRedelivered | boolean |
JMSReplyTo | javax.jms.Destination |
JMSTimestamp | long |
JMSType | String |
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
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
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
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
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
JBossA-MQ:karaf@root>activemq:browse --amqurl tcp://localhost:61616 --msgsel JMSMessaageID='*:10',JMSPriority=3 TEST.FOO