Skip to content
/ msoak Public

MQTT subscribe to mutliple servers / topics simultaneously

License

Notifications You must be signed in to change notification settings

jpmens/msoak

Repository files navigation

msoak

Subscribe to different MQTT brokers and topics simultaneously, and soak up what they have to offer. msoak is documented in it's man page of which there is a version as PDF.

startup

Launch msoak with the example configuration file:

$ msoak example.config

Then publish a message:

mosquitto_pub -t tests/sponge/1 -m "$(jo name=Jane number=42)"

you should see the payload as formatted by Lua. The word loc at start of output is the id of the connection as specified in example.config. (jo is a utility to easily produce JSON output in a shell, and it may well be available as a package for your system of choice.)

loc tests/sponge/1 Hello Jane -> now=18:12:50Z

requirements

running

To test msoak, you will need a source of MQTT test traffic, This could be a test server or a production server that you run, or one of the public test servers. The example configuration assumes that you have a test server running on localhost; edit this to suit.

building

In order to build msoak you will require:

Edit the Makefile to select the system you are building for.

macos

$ brew install lua libconfig mosquitto
$ make

freebsd

# pkg install lua53 libconfig mosquitto
$ make

openbsd

# pkg_add libconfig lua-5.3.5 mosquitto
$ make

debian, ubuntu

# apt-get install libconfig-dev liblua5.3-dev libmosquitto-dev libbsd-dev
$ make

alpine

# apk add build-base libconfig-dev mosquitto-dev lua5.3-dev libbsd-dev
$ make

see also