Continue the JMS feature documentation
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/1a1b57cb Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/1a1b57cb Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/1a1b57cb Branch: refs/heads/master Commit: 1a1b57cbdd4aeea6a7c3b1d21799af024286533a Parents: ffa9ac0 Author: Jean-Baptiste Onofré <[email protected]> Authored: Thu Dec 19 14:33:29 2013 +0100 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Thu Dec 19 14:33:29 2013 +0100 ---------------------------------------------------------------------- manual/src/main/webapp/users-guide/jms.conf | 96 ++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/1a1b57cb/manual/src/main/webapp/users-guide/jms.conf ---------------------------------------------------------------------- diff --git a/manual/src/main/webapp/users-guide/jms.conf b/manual/src/main/webapp/users-guide/jms.conf index 1c8e57d..5cb460a 100644 --- a/manual/src/main/webapp/users-guide/jms.conf +++ b/manual/src/main/webapp/users-guide/jms.conf @@ -99,6 +99,10 @@ karaf@root()> la The {{connectionfactory-test.xml}} file has been created in the {{deploy}} folder. +By default, the {{jms:create}} command constructs a JNDI name for the connection factory: {{/jms/[name]}}. + +It means that the connection factory name to use for the other {{jms:*}} commands is {{/jms/[name]}}. + h3. {{jms:delete}} The {{jms:delete}} command deletes a JMS connection factory. The {{name}} argument is the name that you used at creation time: @@ -132,17 +136,99 @@ version | 5.9.0 You can see the JMS broker product and version. +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. + +h3. {{jms:queues}} + +The {{jms:queues}} command lists the JMS queues available on a JMS broker. For instance: + +{code} +karaf@root()> jms:queues /jms/test +JMS Queues +---------- +MyQueue +{code} + +where {{/jms/test}} is the name of the JMS connection factory. + +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. + +{warning} +Depending of the JMS connection factory type, this command may not work. +For now, the command works only with Apache ActiveMQ. +{warning} + +h3. {{jms:topics}} + +The {{jms:topics}} command lists the JMS topics available on a JMS broker. For instance: + +{code} +karaf@root()> jms:topics /jms/test +JMS Topics +---------- +MyTopic +{code} + +where {{/jms/test}} is the name of the JMS connection factory. + +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. + +{warning} +Depending of the JMS connection factory type, this command may not work. +For now, the command works only with Apache ActiveMQ. +{warning} + h3. {{jms:send}} -The {{jms:send}} command sends a message to a given JMS queue on the broker. +The {{jms:send}} command sends a message to a given JMS queue. -For instance, to send a message containing {{Hello World}} in the {{test}} queue, you can do: +For instance, to send a message containing {{Hello World}} in the {{MyQueue}} queue, you can do: {code} -karaf@root()> jms:send /jms/test test "Hello World" +karaf@root()> jms:send /jms/test MyQueue "Hello World" {code} -The {{jms:send}} command optionally accepts the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options to provide -the username and password to connect to the JMS broker. +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. h3. {{jms:consume}} + +The {{jms:consume}} command consumes messages from a JMS queue. + +For instance, to consume all messages from {{MyQueue}}, you can do: + +{code} +karaf@root()> jms:consume /jms/test MyQueue +2 message(s) consumed +{code} + +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. + +{warning} +The {{jms:consume}} command just consumes (so removes) messages from a JMS queue. It doesn't display the messages. +If you want to see the details of messages, you can use the {{jms:browse}} command. +{warning} + +h3. {{jms:count}} + +The {{jms:count}} command counts the number of pending messages into a JMS queue. + +For instance, if you want to know the number of messages on {{MyQueue}}, you can do: + +{code} +karaf@root()> jms:count /jms/test MyQueue +Messages Count +-------------- +8 +{code} + +If the JMS broker requires an authentication, you can use the {{-u}} ({{--username}}) and {{-p}} ({{--password}}) options. + +h3. {{jms:browse}} + +The {{jms:browse}} command browses a JMS queue and display details about messages. + +For instance, to browse the {{MyQueue}} queue: + +{code} + +{code} \ No newline at end of file
