All Projects → antonwierenga → activemq-cli

antonwierenga / activemq-cli

Licence: Apache-2.0 license
Command Line tool to interact with the Apache ActiveMQ message broker

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to activemq-cli

tgmount
Mount Telegram dialogs and channels as a Virtual File System.
Stars: ✭ 52 (-42.22%)
Mutual labels:  fuse
fs-fuse
Export any Node.js `fs`-like object as a FUSE filesystem
Stars: ✭ 32 (-64.44%)
Mutual labels:  fuse
amqv7-workshop
No description or website provided.
Stars: ✭ 22 (-75.56%)
Mutual labels:  activemq
fuse-device
Use the basic Device functions such as UUID and current localization from Fuse
Stars: ✭ 13 (-85.56%)
Mutual labels:  fuse
hatexmpp
fuse xmpp client (xmppfs). The development stopped, you may like https://github.com/l29ah/hatexmpp3
Stars: ✭ 26 (-71.11%)
Mutual labels:  fuse
spring-projects
Some spring sample projects
Stars: ✭ 24 (-73.33%)
Mutual labels:  activemq
activemq-nms-api
Mirror of Apache ActiveMQ NMS API
Stars: ✭ 30 (-66.67%)
Mutual labels:  activemq
luufs
Lazy man's, user-mode union file system
Stars: ✭ 28 (-68.89%)
Mutual labels:  fuse
Review System Demo
A Spring Boot and AngularJS boilerplate project.
Stars: ✭ 18 (-80%)
Mutual labels:  activemq
ocamlfuse
OCamlFuse mirror with dune support
Stars: ✭ 23 (-74.44%)
Mutual labels:  fuse
blahajfs
No description or website provided.
Stars: ✭ 19 (-78.89%)
Mutual labels:  fuse
activemq-website
Apache ActiveMQ Website
Stars: ✭ 16 (-82.22%)
Mutual labels:  activemq
clamfs
ClamFS is a FUSE-based user-space file system for Linux and BSD with on-access anti-virus file scanning
Stars: ✭ 29 (-67.78%)
Mutual labels:  fuse
profuse
An OCaml implementation of the FUSE protocol versions 7.8 and 7.23
Stars: ✭ 29 (-67.78%)
Mutual labels:  fuse
django-stomp
🔃 A simple implementation of STOMP with Django
Stars: ✭ 31 (-65.56%)
Mutual labels:  activemq
dedupsqlfs
Deduplicating filesystem via Python3, FUSE and SQLite
Stars: ✭ 24 (-73.33%)
Mutual labels:  fuse
rust-fuse
A FUSE server implementation for Rust.
Stars: ✭ 26 (-71.11%)
Mutual labels:  fuse
php-fuse
PHP FFI bindings for libfuse
Stars: ✭ 53 (-41.11%)
Mutual labels:  fuse
rx-stomp
STOMP adaptor for RxJS
Stars: ✭ 76 (-15.56%)
Mutual labels:  activemq
jboss-fuse-examples
[Archived] Collection of JBoss Fuse 6 examples
Stars: ✭ 16 (-82.22%)
Mutual labels:  jboss-fuse

activemq-cli

Command-line tool (Windows/macOS/Linux) to interact with a JMX enabled Apache ActiveMQ message broker.

Your broker is not JMX enabled? Check out amazonmq-cli.

alt text Here is a three minute video that shows how to install, configure and use ActiveMQ CLI.

Installation

Download activemq-cli in the release section of this repository.

Unzip the activemq-cli-x.x.x.zip file and configure the broker you want to connect to in activemq-cli-x.x.x/conf/activemq-cli.config:

broker {
  local {
    amqurl = "tcp://localhost:61616"
    jmxurl = "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
    username = ""
    password = ""
    prompt-color = "light-blue" 
  }

  // add additional brokers here
  dev {
    amqurl = "tcp://development-server:61616"
    jmxurl = "service:jmx:rmi:///jndi/rmi://development-server:1099/jmxrmi"
    username = "admin"
    password = "admin"		
  }	
  
  prod {
    amqurl = "tcp://production-server:61616"
    jmxurl = "service:jmx:rmi:///jndi/rmi://production-server:1099/jmxrmi"
  }	
  
  fuse-server {
    amqurl = "tcp://fuse-server:61616"
    jmxurl = "service:jmx:rmi:///jndi/rmi://fuse-server:1099/karaf-root"  
  }
  
  ssl-server {
    amqurl = "ssl://ssl-server:61616"
    jmxurl = "service:jmx:rmi:///jndi/rmi://ssl-server:1099/jmxrmi"
    
    // SSL 
    keyStore = "~/client.ks"
    keyStorePassword = "secret"
    trustStore = "~/client.ts"
  }  
}

Usage

To enter the activemq-cli shell run activemq-cli-x.x.x/bin/activemq-cli or activemq-cli-x.x.x/bin/activemq-cli.bat if you are using Windows.

activemq-cli provides tab completion to speed up typing commands, to see which commands are available and what parameters are supported.

In addition to executing commands in the shell, activemq-cli also supports executing a file containing commands: activemq-cli --cmdfile my_commands.txt

To connect to a broker that is configured in activemq-cli-x.x.x/conf/activemq-cli.config: connect --broker dev

Below is a list of commands that activemq-cli supports.

add-queue

Adds a queue.

Parameters:
  • name

Example:add-queue --name foo

add-topic

Adds a topic.

Parameters:
  • name

Example:add-topic --name foo

connect

Connects activemq-cli to a broker.

Parameters:
  • broker (broker must be defined in activemq-cli-x.x.x/conf/activemq-cli.config)

Example:connect --broker local

copy-messages

Copies messages from a queue to another queue.

Parameters:
  • from
  • to
  • selector (copy messages that match the (JMS) selector)

Example:copy-messages --from foo --to bar

disconnect

Disconnects activemq-cli from the broker.

Example:disconnect

export-broker

Exports queues, topics and messages to file.

Parameters:
  • file

Example:export-broker --file broker.xml

For this command activemq-cli creates temporary mirror queues to ensure all messages are exported.

export-messages

Exports messages to file.

Parameters:
  • file
  • queue
  • selector (export messages that match the (JMS) selector)
  • regex (export messages whose body match the regex)

Example:export-messages --queue foo

For this command activemq-cli creates a temporary mirror queue to ensure all messages are exported.

info

Displays information (e.g. version, uptime, total number of queues/topics/messages) about the broker

Example:info

list-messages

Lists messages.

Parameters:
  • queue
  • selector (lists messages that match the (JMS) selector)
  • regex (lists messages whose body match the regex)

Example 1:list-messages --queue foo

Example 2:list-messages --queue foo --selector "JMSCorrelationID = '12345'"

Example 3:list-messages --queue foo --regex bar

For this command activemq-cli creates a temporary mirror queue to ensure all messages are listed.

list-queues

Lists queues.

Parameters:
  • filter (list queues with the specified filter in the name)
  • exclude-filter (list queues without the specified exclude-filter in the name)
  • pending (list queues for which the number of pending messages meets the pending filter)
  • enqueued (list queues for which the number of enqueued messages meets the enqueued filter)
  • dequeued (list queues for which the number of dequeued messages meets the dequeued filter)
  • consumers (list queues for which the number of consumers meets the consumers filter)

Example 1:queues --filter foo

Example 2:queues --pending >0 --consumers =0

list-topics

Lists topics.

Parameters:
  • filter (list topics with the specified filter in the name)
  • enqueued (remove topics for which the number of enqueued messages meets the enqueued filter)
  • dequeued (remove topics for which the number of dequeued messages meets the dequeued filter)

Example 1:topics --filter foo

Example 2:topics --enqueued >0

move-messages

Moves messages from a queue to another queue.

Parameters:
  • from
  • to
  • selector (move messages that match the (JMS) selector)

pause-queue

Pauses a queues.

Parameters:
  • name
  • force (no prompt for confirmation)

Example:pause-queue --name foo

purge-all-queues

Purges all queues.

Parameters:
  • force (no prompt for confirmation)
  • dry-run (use this to test what is going to be purged, no queues are actually purged)
  • filter (queues with the specified filter in the name)
  • exclude-filter (list queues without the specified exclude-filter in the name)
  • pending (purge queues for which the number of pending messages meets the pending filter)
  • enqueued (purge queues for which the number of enqueued messages meets the enqueued filter)
  • dequeued (purge queues for which the number of dequeued messages meets the dequeued filter)
  • consumers (purge queues for which the number of consumers meets the consumers filter)

Example 1:purge-all-queues

Example 2:purge-all-queues --filter foo --consumers =0 --dry-run

purge-queue

Purges a queues.

Parameters:
  • name
  • force (no prompt for confirmation)

Example:purge-queue --name foo

release-notes

Displays the release notes.

Example:release-notes

remove-all-queues

Removes all queues.

Parameters:
  • force (no prompt for confirmation)
  • dry-run (use this to test what is going to be removed, no queues are actually removed)
  • filter (queues with the specified filter in the name)
  • exclude-filter (list queues without the specified exclude-filter in the name)
  • pending (remove queues for which the number of pending messages meets the pending filter)
  • enqueued (remove queues for which the number of enqueued messages meets the enqueued filter)
  • dequeued (remove queues for which the number of dequeued messages meets the dequeued filter)
  • consumers (remove queues for which the number of consumers meets the consumers filter)

Example 1:remove-all-queues

Example 2:remove-all-queues --filter foo --consumers =0 --dry-run

remove-all-topics

Removes all topics.

Parameters:
  • force (no prompt for confirmation)
  • dry-run (use this to test what is going to be removed, no queues are actually removed)
  • filter (queues with the specified filter in the name)
  • enqueued (remove topics for which the number of enqueued messages meets the enqueued filter)
  • dequeued (remove topics for which the number of dequeued messages meets the dequeued filter)

Example 1:remove-all-topics

Example 2:remove-all-topics --filter foo --enqueued =0 --dry-run

remove-queue

Removes a queue.

Parameters:
  • name
  • force (no prompt for confirmation)

Example:remove-queue --name foo

remove-topic

Removes a topic.

Parameters:
  • name
  • force (no prompt for confirmation)

Example:remove-topic --name foo

resume-queue

Resumes a queues.

Parameters:
  • name
  • force (no prompt for confirmation)

Example:resume-queue --name foo

send-message

Sends a message or file of messages to a queue or topic.

Parameters:
  • body
  • queue
  • topic
  • priority (not applicable if -file is specified)
  • correlation-id (not applicable if -file is specified)
  • reply-to (not applicable if -file is specified)
  • delivery-mode (not applicable if -file is specified)
  • time-to-live (not applicable if -file is specified)
  • times (number of times the message is sent)
  • type (not applicable if -file is specified)
  • file

Example file:

<jms-messages>
  <jms-message>
    <body>Message 1</body>
  </jms-message>
  <jms-message>
    <body>Message 2</body>
  </jms-message>  
  <jms-message>
    <header>
      <priority>0</priority>
      <correlation-id>12345</correlation-id>
      <reply-to>myRepliesQueue</reply-to>
      <delivery-mode>2</delivery-mode>
      <time-to-live>1000</time-to-live>
      <type>myCustomType</type>
    </header>
    <properties>
      <property>
        <name>my_custom_property</name>
        <value>1</value>
      </property>        
    </properties>      
    <body><![CDATA[<?xml version="1.0"?>
<catalog>
   <book id="1">
      <author>Basil, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2002-10-01</publish_date>
      <description>An in-depth look at creating applications with XML.</description>
   </book>
</catalog>]]></body>
  </jms-message>  
</jms-messages>

Example 1:send-message --body foo --queue bar

Example 2:send-message --file foo.xml --topic bar

start-embedded-broker

Starts the embedded broker.

The embedded broker is configured in activemq-cli-x.x.x/conf/activemq-cli.config:

embedded-broker {
	connector = "tcp://localhost:61616"
	jmxport = 1099	
}

Example:start-embedded-broker

stop-embedded-broker

Stops the embedded broker.

Example:stop-embedded-broker

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].