简体   繁体   中英

Mqtt broker and mqtt bridge on same system

I am working on a project where I have to connect local mqtt broker ie mosquitto and a cloud based mqtt broker via mqtt bridge. Mosquitto(local broker) is running on raspberry pi4 and I also want to run mosquitto mqtt bridge on same raspberry pi. So the question is, Can I run local mqtt broker ie mosquitto and the mqtt bridge both simultaneously in a single system which is raspberry pi4. If yes please tell the process how can i do it.

You only need to run a single MQTT broker (eg mosquitto). This will act as the local broker and can also be configured to bridge out to a remote broker.

The bridge can be configured to

  • mirror messages out to the remote broker
  • mirror messages in from the remote broker
  • or both

Depending on what you need. Details of how to configure the bridge can be found in the mosquitto docs here

But if you want to run multiple brokers on the same machine this is also perfectly possible, they will just need to bind to different ports as only one will be able to bind to 1883.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM