mqttmosquittomqtt-vernemq

Bridging an MQTT broker to 2 remote MQTT brokers simultaneously


We have many local gateways installed at different premises. These gateways will host an MQTT broker for connecting all the local services. Then it is required that the local MQTT broker sends this data to two remote MQTT brokers (each hosted with a different party). I have read the documentation on Mosquitto and VerneMQ brokers and I see that they only allow one remote server to be bridged at a time.

Is there another (open source) broker which provides such functionality? If not how can we achieve this?


Solution

  • You can declare are many bridges as you want with mosquitto.

    From the mosquitto.conf man page:

    Configuring Bridges

    Multiple bridges (connections to other brokers) can be configured using the following variables.

    You just have multiple blocks starting with connection

    connection test-mosquitto-org
    address test.mosquitto.org
    cleansession true
    topic clients/total in 0 test/mosquitto/org $SYS/broker/
    
    connection foo.broker.org
    address 192.168.1.1
    topic # both 0