Chapter 4. Configuring Messaging Destinations Note Remember, configuring messaging destinations requires JBoss EAP to have messaging enabled. This functionality is enabled by default when running with the standalone-full.xml or standalone-full-ha.xml configuration files. The domain.xml configuration file also has messaging enabled. 4.1. Adding a Queue To add a Jakarta Messaging queue, use the jms-queue command from the management CLI: Note how the entries attribute is a list containing multiple JNDI names separated by a single space. Also note the use of square brackets, [] , to enclose the list of JNDI names. The queue-address provides routing configuration, and entries provides a list of JNDI names that clients can use to look up the queue. Reading a Queue's Attributes You can read a queue's configuration using the jms-queue command in the management CLI. Alternatively, you can read a queue's configuration by accessing the messaging-activemq subsystem using the management CLI: Attributes of a jms-queue The management CLI displays all the attributes of the jms-queue configuration element when given the following command: The table below provides all the attributes of a jms-queue : Attribute Description consumer-count The number of consumers consuming messages from this queue. Available at runtime. dead-letter-address The address to send dead messages to. See Configuring Dead Letter Addresses for more information. delivering-count The number of messages that this queue is currently delivering to its consumers. Available at runtime. durable Whether the queue is durable or not. See Messaging Styles for more information on durable subscriptions. entries The list of JNDI names the queue will be bound to. Required. expiry-address The address that will receive expired messages. See Configuring Message Expiry for details. legacy-entries The JNDI names the queue will be bound to. message-count The number of messages currently in this queue. Available at runtime. messages-added The number of messages added to this queue since it was created. Available at runtime. paused Whether the queue is paused. Available at runtime. queue-address The queue address defines what address is used for routing messages. See Configuring Address Settings for details on address settings. Required. scheduled-count The number of scheduled messages in this queue. Available at runtime. selector The queue selector. For more information on selectors see Filter Expressions and Message Selectors . temporary Whether the queue is temporary. See Temporary Queues and Runtime Queues for more information. 4.2. Adding a Topic Adding or reading a topic is much like adding a queue: Reading a Topic's Attributes Reading topic attributes also has syntax similar to that used for a queue: Attributes of a jms-topic The management CLI displays all the attributes of the jms-topic configuration element when given the following command: The table below lists the attributes of a jms-topic : Attribute Description delivering-count The number of messages that this queue is currently delivering to its consumers. Available at runtime. durable-message-count The number of messages for all durable subscribers for this topic. Available at runtime. durable-subscription-count The number of durable subscribers for this topic. Available at runtime. entries The JNDI names the topic will be bound to. Required. legacy-entries The legacy JNDI names the topic will be bound to. message-count The number of messages currently in this queue. Available at runtime. messages-added The number of messages added to this queue since it was created. Available at runtime. non-durable-message-count The number of messages for all non-durable subscribers for this topic. Available at runtime. non-durable-subscription-count The number of non-durable subscribers for this topic. Available at runtime. subscription-count The number of (durable and non-durable) subscribers for this topic. Available at runtime. temporary Whether the topic is temporary. topic-address The address the topic points to. Required. 4.3. JNDI Entries and Clients A queue or topic must be bound to the java:jboss/exported namespace for a remote client to be able to look it up. The client must use the text after java:jboss/exported/ when doing the lookup. For example, a queue named testQueue has for its entries the list jms/queue/test java:jboss/exported/jms/queue/test . A remote client wanting to send messages to testQueue would look up the queue using the string jms/queue/test . A local client on the other hand could look it up using java:jboss/exported/jms/queue/test , java:jms/queue/test , or more simply jms/queue/test . Management CLI Help You can find more information about the jms-queue and jms-topic commands by using the --help --commands flags: 4.4. Pause method for Jakarta Messaging topics using the management API You can pause a topic by pausing all its consumers. If the topic has any new subscriptions being registered while the topic is in pause are also paused. The subscribers of the topic do not receive new messages from the paused topic. However, the paused topic can still receive messages sent to it. When you resume the topic, the queued messages are delivered to the subscribers. You can use the persist parameter to store the state of the topic so that the topic stays paused even if you restart the broker. Additional resources For information about pausing a topic, see Pausing a topic . For information about resuming a topic, see Resuming a topic . 4.5. Pausing a topic You can pause a topic so that all the subscribers of the topics stop receiving new messages from a paused topic. Procedure Pause the topic as shown in the following example: A paused topic is as shown in the following example: Additional resources For information about the pause method for topics, see Pause method for Jakarta Messaging topics using the management API . For information about resuming a topic, see Resuming a topic . 4.6. Resuming a topic You can resume a paused topic. When you resume the topic, the messages the topic received while it was paused are delivered to the subscribers. Procedure Resume the topic as shown in the following example: A resumed topic is as shown in the following example: Additional resources For information about the pause method for topics, see Pause method for Jakarta Messaging topics using the management API . For information about pausing a topic, see Pausing a topic .

Commands:
jms-queue add --queue-address=myQueue --entries=[queue/myQueue jms/queue/myQueue java:jboss/exported/jms/queue/myQueue]
jms-queue read-resource --queue-address=myQueue
/subsystem=messaging-activemq/server=default/jms-queue=myQueue:read-resource() { "outcome" => "success", "result" => { "durable" => true, "entries" => ["queue/myQueue jms/queue/myQueue java:jboss/exported/jms/queue/myQueue"], "legacy-entries" => undefined, "selector" => undefined } }
/subsystem=messaging-activemq/server=default/jms-queue=*:read-resource-description()
jms-topic add --topic-address=myTopic --entries=[topic/myTopic jms/topic/myTopic java:jboss/exported/jms/topic/myTopic]
jms-topic read-resource --topic-address=myTopic entries topic/myTopic jms/topic/myTopic java:jboss/exported/jms/topic/myTopic legacy-entries=n/a
/subsystem=messaging-activemq/server=default/jms-topic=myTopic:read-resource { "outcome" => "success", "result" => { "entries" => ["topic/myTopic jms/topic/myTopic java:jboss/exported/jms/topic/myTopic"], "legacy-entries" => undefined } }
/subsystem=messaging-activemq/server=default/jms-topic=*:read-resource-description()
jms-queue --help --commands
jms-topic --help --commands
/subsystem=messaging-activemq/server=default/jms-topic=topic:pause() { "outcome" => "success", "result" => undefined }
/subsystem=messaging-activemq/server=default/jms-topic=topic:read-attribute(name=paused) { "outcome" => "success", "result" => true }
/subsystem=messaging-activemq/server=default/jms-topic=topic:resume() { "outcome" => "success", "result" => undefined }
/subsystem=messaging-activemq/server=default/jms-topic=topic:read-attribute(name=paused) { "outcome" => "success", "result" => false }