mqtt-stream

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

GitHub release Go Report Card license

mqtt-stream

MQTT client that creates a data stream using two topics

  • Data from topic from goes to stdout.
  • Data from stdin goes topic to.
  • If echo is enabled: data from topic from goes to topic to.

Usage

mqtt-stream --host tcp://test.mosquitto.org:1883 --from bar --to foo

Launch mqtt-stream --help to see all available parameters.

Echo example using mosquitto

Create a subscription to foo topic using mosquitto_sub

mosquitto_sub -h test.mosquitto.org -t bar

Launch mqtt-stream with echo enabled

mqtt-stream --host tcp://test.mosquitto.org:1883 --from bar --to foo --echo

Publish some data to topic bar using mosquitto_pub

mosquitto_pub -h test.mosquitto.org -t bar -m "hello world"

Output

$ mosquitto_sub -h test.mosquitto.org -t foo
hello world
$ mqtt-stream --host tcp://test.mosquitto.org:1883 --from bar --to foo
2020/02/05 13:51:45 connecting to tcp://test.mosquitto.org:1883...
2020/02/05 13:51:45 connected!
2020/02/05 13:51:45 subscribed to bar, publishing to foo
2020/02/05 13:51:46 hello world

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL