48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
= Multi Level Wildcard
|
|
|
|
Abbonieren Sie einmal alles.
|
|
|
|
|
|
Abbonieren Sie alles, was zu `training` oder `schulung` gehört.
|
|
|
|
Senden Sie Nachrichten an
|
|
- training/mqtt/student
|
|
- schulung/mqtt/teilnehmer
|
|
- all
|
|
|
|
Funktioniert alles, wie erwartet?
|
|
|
|
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_sub \
|
|
--topic '#' \
|
|
--debug
|
|
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_sub \
|
|
--topic 'training/#' --topic 'schulung/#' \
|
|
--debug
|
|
|
|
|
|
Versand der Testnachrichten:
|
|
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_pub \
|
|
--topic training/mqtt/student --message "hello: training/mqtt/student"
|
|
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_pub \
|
|
--topic schulung/mqtt/teilnehmer --message "hello: schulung/mqtt/teilnehmer"
|
|
|
|
// FIX: nur topic 'all' um zu zeigen das dieses nur bei dem ersten sub erhalten wird
|
|
aber nicht bei 'training/#' und 'schulung/#'
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_pub \
|
|
--topic all --message "hello: all"
|
|
|
|
|
|
|
|
Erhalten Sie auch System-Nachrichten?
|
|
|
|
Abbonieren Sie explizit alle `$SYS` Topics.
|
|
|
|
$ docker run --rm -it --net host eclipse-mosquitto mosquitto_sub \
|
|
--topic '$SYS/#' \
|
|
--debug
|
|
|