Plunger is a simple messaging client for the shell. It will closely follow the principles of *nix programs that allow chaining by piping output from one program to another. The output is readable by humans, textual, but also usable for further processing and manipulation.
It is written in Java 8, and provides convenience scripts for bash.
- ls - lists the available destinations
- cat - consumes/reads messages
- put - sends messages to a destination
- count - shows the number of messages/consumers for a destination
Basic usage is:
plunger <target> [options]
You can always use --help
to see the common arguments or, when given, the command-specific arguments.
- -C,--command <arg> / The command to execute against the target
- -colors <arg> / Highlights the output
- -h,--help / Print program usage
- -v,--verbose / Verbose mode. Causes plunger to print debugging messages about its progress.
- -version / Prints the version
There is a shortcut for each command, so instead of writing eg. plunger <target> -C ls -rv
you can simply write pls <target> -rv
. The name of the shortcut is p<Command>
.
The target is an uri that represents the message broker. You can either pass a target directly, or define an alias for easier usage in the .plunger
file (see below).
The direct notation is provider://[username[:password]@]host[:port][/destination]
plunger makes use of a configuration file, when available. It is comparable with the ~/.ssh/config file. Targets can be predefined for easier access with aliases. You can asign multiple aliases to a target.
The configuration file will be selected in the following order:
$XDG_CONFIG_HOME/plunger/targets
$HOME/.config/plunger/targets
$HOME/.plunger
Available properties are Alias
and Target
Simple example:
Alias local hq
Target hornetq://username:password@localhost:5445/queue.test
So instead of writing eg. pls hornetq://username:password@localhost:5445/queue.test
you can simply write pls local
or pls hq
. You also can override elements such as the destination, eg. pls hq/queue.other
.
Note: When a destination is predefined, and you want to show all queues with pls
, simply erase the destination by appending a slash like eg. pls hq/
.
Plunger is messaging system agnostic, any message broker can be added. To do this, you have to implement the CommandProvider interface as SPI.
- JBoss HornetQ setup >= 2.2.5 -- protocol-name: hornetq
- Apache ActiveMQ setup >= 5.8.0 -- protocol-name: amq
- RabbitMQ setup >= 3.5.x -- protocol-name: rabbitmq
- Apache Kafka setup >= 0.10.1 -- protocol-name: kafka
Other provides are planned, and might be implemented (of course you can create a PR as well). Take a look at the issue-list.
See Building plunger