LETS说您的“ A”经纪人通过分支订单/命令发送命令 和您的“ B”经纪人在家中保持传感器值
然后,如果您在Broker“ A”上发布消息/命令/命令/,您将在Brok'B“。此外,每个传感器价值都可以发布给家庭/传感器/在经纪“ b”的传感器/传感器,将镜像为家庭/传感器/在经纪人/经纪人“ A”
Mosquitto.conf:( Raspberry“ A”是192.168.1.100)
connection raspi-PC
address 192.168.1.110:1883
topic # both 0 order/command/ home/sensor/
client1 : mosquitto_sub -h 192.168.1.110 -t order/command/#
client2 : mosquitto_sub -h 192.168.1.100 -t home/sensor/#
clientA : mosquitto_pub -t order/command/message -m "Hello from A"
clientB : mosquitto_pub -t home/sensor/temp -m "22.5C"
client1-> order/command/message/“ hello a a a”
client2-> home/sensor/temp/“ 22.5c”
您看到客户端和客户端2是经纪人“ A”和“ B”的交叉订阅者,他们收到了所有分支机构和子分支消息,但它们不一定是经纪人本地的。
在客户端和客户室中,我使用本地客户端将消息发送给本地经纪人。