brokerc is a cross-platform publish and subscribe command line client tool, including mqtt client, amqp client, kafka client, http client.
To install the library, follow the classical:
$ go get github.com/godaner/brokerc
Or get it from the released version:
https://github.com/godaner/brokerc/releases
Note: curl -LJO https://github.com/godaner/brokerc/releases/download/v1.0.2/brokerc_linux-amd64.tar.gz, tar -zxvf brokerc_linux-amd64.tar.gz
This library works (and is tested) on the following platforms:
Platform | Architecture | Status |
---|---|---|
Linux | amd64 |
✅ |
386 |
✅ | |
Windows | amd64 |
✅ |
386 |
✅ | |
Others | Others |
⏳ |
$ ./brokerc --help
NAME:
brokerc - brokerc is a cross-platform publish and subscribe command line client tool, including mqtt client, amqp client, kafka client, http client.
USAGE:
brokerc [global options] command [command options] [arguments...]
VERSION:
v1.0.2
COMMANDS:
mqttpub publish mqtt message
mqttsub subscribe mqtt message
amqpsub subscribe amqp message
amqppub publish amqp message
kafkapub publish kafka message
kafkasub subscribe kafka message
httppub publish http message
httpsub subscribe http message
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help show help
--version print the version
./brokerc mqttpub \
tcp://system:manager@192.168.2.60:1883 \
-t "/a/b" \
-i "mqttpub" \
-m 'cas' \
--will-payload 'pub bye' \
--will-topic 'will'
./brokerc mqttpub \
ssl://system:manager@localhost:1883 \
-t "/a/b" \
-i "mqttpub" \
-m 'cas' \
--will-payload 'pub bye' \
--will-topic 'will' \
-insecure \
-cafile '/opt/OmniVista_2500_NMS/data/cert/wma/ca.cer' \
-cert /opt/OmniVista_2500_NMS/data/cert/wma/wma.pem \
-key /opt/OmniVista_2500_NMS/data/cert/wma/wma.key
./brokerc mqttsub \
tcp://system:manager@192.168.2.60:1883 \
-t "/a/b" \
-i "mqttsub" \
--will-payload 'sub bye' \
--will-topic 'will'
./brokerc mqttsub \
ssl://system:manager@localhost:1883 \
-t "/a/b" \
-i "mqttsub" \
--will-payload 'sub bye' \
--will-topic 'will' \
-insecure \
-cafile '/opt/OmniVista_2500_NMS/data/cert/wma/ca.cer' \
-cert /opt/OmniVista_2500_NMS/data/cert/wma/wma.pem \
-key /opt/OmniVista_2500_NMS/data/cert/wma/wma.key
./brokerc amqppub \
amqp://system:manager@192.168.2.60:5672 \
-t "/a/b" \
-i "amqpsubclient" \
--exchange "amqpexchange" \
-m 'hey man!'
./brokerc amqpsub \
amqp://system:manager@192.168.2.60:5672 \
-t "/a/b" \
-i "amqpsubclient" \
--queue "amqpqueue" \
--exchange "amqpexchange" \
--exchange-type "direct" \
--queue-ad \
--exchange-ad
./brokerc httppub \
http://127.0.0.1:2222/apiv1/do \
-H "K1:A=C;K2:B=D;K1:E=F;" \
-m 'hey man!'
./brokerc httpsub \
-h :2222
./brokerc kafkapub \
192.168.2.10:9092 \
-t "ktopic" \
-m 'test message'
./brokerc kafkasub \
192.168.2.10:9092 \
-t "ktopic" \
-p 3 \
-r 1 \
-q "kqueue"