Plumber examples

Published on 06/08/2023

Plumber is a CLI tool for inspecting and interacting with a moltitude of message systems like RabbitMQ, Kafka and more others.

I use it a lot for debugging and testing MQTT communications using RabbitMQ.

This article would be a sort of cookbook for me (and others) presenting some usage examples.

Continuous read from RabbitMQ

plumber read rabbit \
    --address="amqp://<USER>:<PASSWORD>@localhost:5672/VHOST" \
    --exchange-name=amq.topic \
    --queue-name="QUEUE_NAME" \
    --binding-key=".topic.TOPIC_NAME" \
    --continuous
    --verbose-output

Send a mqtt payload (JSON content in this case)

plumber write mqtt \
  --address="tcp://<USER>:<PASSWORD>@localhost:1883" \
  --topic=<TOPIC> \
  --input "{\"timestamp\": 1588254741, \"value\": 23.4 }"

REMEMBER: If the user contains : character, you have to escape it with %3A example: user:1 -> user%3A1

Send a mqtt payload using tls

plumber write  mqtt \
  --address=ssl://<USER>:<PASSWORD>@localhost:8883 \
  --topic=<TOPIC> \
  --input "{\"timestamp\": 1588254741, \"value\": 23.4 }" \
  --tls-ca-cert=/path/to/ca_certificate.pem \
  --tls-client-key=/path/to/client_key.pem \
  --tls-client-cert=/path/to/client_certificate.pem
  • Article is published under CC-BY 4.0
  • If not explicitly declared code snippets are published under MIT license