38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
= Bidirektionale Mosquitto Bridge (lab10)
|
|
|
|
|
|
Konfigurieren Sie eine Bridge zu `test.mosquitto.org`, verwenden Sie eine feste
|
|
`remote_clientid`, z.B. training-studentXX.
|
|
|
|
|
|
listener 1883
|
|
listener_allow_anonymous true
|
|
|
|
connection mosquitto-bridge
|
|
address test.mosquitto.org:1883
|
|
remote_clientid training-demo
|
|
|
|
|
|
Das Remote-Topic `$SYS/broker/clients/total` soll auf `remote/clients/total` gemappt werden.
|
|
Die lokale Topichierarchie `sensors/#` soll ausgehend auf `mqtt-training/sensors/#` gemappt werden.
|
|
|
|
|
|
topic broker/clients/total in 1 remote/ $SYS/
|
|
topic # out 1 sensors/ mqtt-training/sensors/
|
|
|
|
|
|
|
|
$ docker run --rm -it --init --net host -v $PWD:/mosquitto/config eclipse-mosquitto
|
|
|
|
|
|
Validieren Sie den Status der Bridge und dass Nachrichten ankommen - sowohl lokal als auch remote
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub --qos 1 --topic '$SYS/broker/connection/#' --topic '#' --debug
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_sub --host test.mosquitto.org --qos 1 --topic 'mqtt-training/#' --debug
|
|
|
|
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
|
mosquitto_pub --qos 1 --topic sensors/trainer --message "to bridge" --debug
|