Bridges

A bridge is a built-in MQTT client in the broker which can connect to another broker and forward messages between the brokers.

Configuration

Bridges are configured from the Bridges page in the console. If you are on Cute cat plan you're missing Bridges feature.

Bridge configuration form

Username, password, hostname and port are mandatory values needed to connect to the remote broker.

Topic will be used in subscription in the local broker and/or the remote broker, depending on the direction configuration.

  • Out will publish messages from local broker to remote broker
  • In will receive messages from remote broker to local broker
  • Both will publish and receive messages

Local and remote prefix is used to remap subtrees of topics. The topic entered in the topic field will be prepended with the remote/local prefix before the subscriptions is done. E.g. for a out bridge where topic=A and local prefix=sub/tree the broker will subscribe to the local topic sub/tree/A but publish the messages to A in the remote broker. If you then set remote prefix=some/path it will be prepended to the topic on publish which means that the message will be published to some/path/A in the remote broker. Topic can be set to # to forward all local topics under sub/tree to remote topics under some/path .

Advanced configuration

Advanced configuration let you set options like TLS/SSL and Quality of Service.

Bridge advanced configuration form

Remote clientid is the clientid the bridge will use for the remote connection. If left empty the bridge will use a combination of the bridge configuration identifier (generated by CloudMQTT) and the hostname.

TLS/SSL enables TLS for the connection. When set you'll be able to select which TLS version the bridge should use.

QoS sets the Quality of Service the bridge will use for publish and subscribe.

Keepalive interval is the maximumber number of seconds the client can idle before it's being treated as disconnected due to timeout. The bridge uses PING to stay alive.

Clean sessions controls whether the boker and client should clear stored states when the client reconnects after a disconnect.

Try private set will make the bridge indicate to the remote broker that it is a bridge, which will help detect message loops. Some brokers doesn't support this, so disable this if your bridge can't connect.

Examples

Some times it's not always straight up how to configure a bridges with another MQTT service.

Azure IoT Hub

Hostname, username, password and port should be pretty straight forward, just make sure to include SharedAccessSignature in your password.

Then you need to set remote clientid to your device name and enable TLS/SSL and select TLSv1.0.