jms-tool is a command line utility tool that is used to troubleshoot JMS connections and related business use cases. Especially jms-tool could be used to pick erroneous messages from the message queues in order to continue business operations.
# download jms-tool
wget <url>
# run jms-tool
java -jar jms-tool.jar [options]
java -jar jms-tool.jar publish
-url <connection url; required>
-queue <queue name; required>
[-count <number of messages to be published; default: 1>]
[-message <message to be published; default: Test message %d generated by JmsTool>]
java -jar jms-tool.jar publish
-url "amqp://admin:password@clientid/carbon?brokerlist='tcp://wso2ei-broker-mgt:5675'"
-queue test-queue
java -jar jms-tool.jar consume
-url <connection url; required>
-queue <queue name; required>
[-count <number of messages to be consumed; default: 1>]
[-timeout <message consume timeout/ms; default: 5000ms>]
[-nowait]
java -jar jms-tool.jar consume
-url "amqp://admin:password@clientid/carbon?brokerlist='tcp://wso2ei-broker-mgt:5675'"
-queue test-queue
-nowait
java -jar jms-tool.jar help
Usage: <main class> [options] [command] [command options]
Options:
-v
Verbose mode logging
Default: false
Commands:
publish Publish messages to a JMS queue
Usage: publish [options]
Options:
-count
Number of messages to be published
Default: 1
-message
Message to be published to the queue
Default: Test message %d generated by JmsTool
* -queue
JMS message queue name to publish messages
* -url
AMQP connection url of the message broker
(amqp://[<user>:<pass>@][<clientid>]<virtualhost>[?brokerlist='<broker
url>[;<broker url>]'])
consume Consume messages from a JMS queue
Usage: consume [options]
Options:
-count
Number of messages to be consumed
Default: 1
-nowait
Don't wait for messages
Default: false
* -queue
JMS message queue name to consume messages
-timeout
Message receive timeout in milli-seconds
Default: 5000
* -url
AMQP connection url of the message broker
(amqp://[<user>:<pass>@][<clientid>]<virtualhost>[?brokerlist='<broker
url>[;<broker url>]'])
help
Usage: help
- Java (Tested in OpenJDK 1.8)
- Channa Jayamuni ([email protected])