MQTT Bridge Overview
TheMQTT_BRIDGE route connects your Coreflux broker to another MQTT broker and keeps selected topics in sync between them. Use it for edge-to-cloud synchronization, linking multiple sites, or mirroring data to a backup broker.
When to use it
- Push local sensor data from an edge device up to a cloud broker.
- Pull commands or configuration from a central broker down to remote sites.
- Keep two brokers continuously in sync for redundancy.
Let’s look at how to define a bridge, starting with the most common scenarios.
Quick Start
- Edge to cloud (out)
- Cloud to edge (in)
- Bidirectional (both)
Forward local sensor data up to a cloud broker over TLS:
Connection Configuration
A bridge has two endpoints: aSOURCE_CONFIG (usually your local broker) and a DESTINATION_CONFIG (the remote broker). Use WITH BROKER SELF for the local Coreflux broker, or provide explicit connection details for a remote one.
Broker Settings
Broker Settings
TLS/Security
TLS/Security
Connection Handling
Connection Handling
Number of reconnection attempts. Default: 5.
Mapping Configuration
EachADD MAPPING block defines which topics are bridged and in which direction.
Secure mTLS Bridge
For production links between sites, encrypt both endpoints and authenticate with mutual TLS:Best Practices
Use TLS for External Connections
Use TLS for External Connections
Always enable TLS when connecting to external brokers:
Unique Client IDs
Unique Client IDs
Each bridge connection needs a unique CLIENT_ID to avoid conflicts:
Test with Local Broker First
Test with Local Broker First
Use
WITH BROKER SELF during development:Secure Credentials
Secure Credentials
Store passwords securely and use app-specific passwords where available.
Handle Reconnection
Handle Reconnection
Configure appropriate retry settings:
Troubleshooting
Bridge Connection Timeout
Bridge Connection Timeout
- Verify IP address and port are correct
- Check firewall allows outbound connections on the configured port
- Ensure remote broker is running and accessible
- Try increasing
RECONNECTION_RETRIES
TLS/Certificate Errors
TLS/Certificate Errors
- Verify certificate paths are correct
- Ensure certificates are valid and not expired
- Check certificate chain is complete
- For testing, use
ALLOW_UNTRUSTED_CERTS "true"(not recommended for production)
Messages Not Bridging
Messages Not Bridging
- Verify SOURCE_TOPIC and DESTINATION_TOPIC are correct
- Check DIRECTION setting matches your expected data flow
- Ensure CLIENT_ID is unique across all connections
- Check broker logs for subscription errors
Next Steps
Send alerts and notifications from MQTT messages.
Kafka
Stream data between MQTT and Apache Kafka.

