For a fist attempt, the problem is that the address field is a list of brokers to which you should try to connect in order, and not a list of simultaneous brokers connections.
How this list is interpreted depends on the round_robin parameter.
If set to true , then the broker will connect to the first one in the list, and when the connection drops, he will try the next one in the list, moving the list through each reconnection.
If set to false , it will connect to the first and consider this as the preferred connection. When the connection fails, he will try to connect again, if he fails, he will move down the list, but periodically try to reconnect to the fist in the list.
To solve your problem, try something like this:
mosquitto.broker.A
connection sync-a try_private false address mosquitto.broker.sync:1883 notifications true topic
mosquitto.broker.B
connection sync-b try_private false address mosquitto.broker.sync:1883 notifications true topic # out 2 "" B/ topic # in 2 "" A/
And leave the synchronizer as it is.
Prefixes are used here so as not to create loops. It also means that you can keep track of which broker is doing what is on the synchronization machine, since all topics are prefixed with the machine from which they came.
source share