Third-Party MQTT Forwarding
The current platform forwards ThinkLink messages to a third-party MQTT broker through Broker + Forwarder.
There is no per-device third-party forwarding switch, and there is no Server Configuration entry for a third-party platform. Those legacy settings are retired. Configure the Broker records and enable the corresponding Forwarder rule; messages matching its subscription topic are then forwarded automatically.
The typical data flow is:
ThinkLink internal Broker (AS or ThinkLink)
↓ Source Broker / Subscription Topic
Forwarder rule (optional JavaScript transformation)
↓ Target Broker
Third-party MQTT Broker (Customize)1. Create Broker Connections
Go to Advanced Features → Broker. A forwarding rule normally uses one source connection and one target connection.
Source Broker
Select one of the internal types as required:
AS: MQTT messages from the ThinkLink Application Server.ThinkLink: messages processed by the ThinkLink platform.
The platform fills the internal broker address and tenant credentials automatically. You do not retrieve or maintain them under Server Configuration.
Third-Party Target Broker
Create a Customize Broker and enter the connection information supplied by the third-party provider:
- Name and Enabled status.
- MQTT URL, such as
mqtt://host:1883ormqtts://host:8883. - Username and password when required.
- CA and client certificates when TLS or mutual TLS is required.
After saving and enabling it, check the Broker list. A successful connection reports RUNNING. If it reports ERROR, inspect ErrMsg and verify the URL, port, credentials, certificates, and network path.
2. Create and Enable the Forwarder
Go to Advanced Features → Forwarder → Add and configure:
| Field | Description |
|---|---|
| Name | Forwarding rule name |
| Enabled | The rule subscribes and forwards only when enabled |
| Source Broker | Broker to subscribe to |
| Target Broker | Broker to publish to |
| Subscription Topic | Topic pattern on the source; supports MQTT + and # wildcards |
| Custom Script | Optional transformation of the topic, payload, or retain option |
| Notes / commit message | Optional explanation and version-history note |
Once the Forwarder is saved and enabled, every message matching Subscription Topic is sent to Target Broker. No device-side change is required.
Source Broker and Target Broker cannot both be internal AS/ThinkLink types, which prevents an unnecessary internal loop. The common third-party forwarding pair is:
Source Broker = AS or ThinkLink
Target Broker = Customize3. Optional Transformation Script
Without a script, the Forwarder preserves the original topic and message. Use this entry point when the third-party system requires another payload format:
function forwardScript({ topic, msg, org_params }) {
if (!msg?.telemetry_data) return null
return {
topic: `${org_params.target_topic_prefix}/${msg.device_id}`,
option: {
retain: false
},
msg: {
temperature: msg.telemetry_data.T,
humidity: msg.telemetry_data.H
}
}
}Inputs:
| Parameter | Type | Description |
|---|---|---|
topic | string | Original MQTT topic received by the Forwarder |
msg | Object | Parsed message payload |
org_params | Object | Read-only organization parameters maintained under System Management → Server Configuration → Org Params; this is shared script data, not a third-party forwarding switch or Broker configuration |
The returned object supports:
| Field | Type | Description |
|---|---|---|
topic | string | Topic published to the target Broker |
msg | Object | Message payload to publish |
option | Object | Optional MQTT publish settings, such as { retain: true } |
Return null, or return nothing, to discard the message.
4. Version History and Public Forwarders
Each saved Forwarder script creates a version snapshot. The editor can show details or restore an earlier snapshot. Restoring creates a new version record and does not delete existing history.
System Platform can maintain public Forwarders. They are visible but read-only on the tenant side. A rule assigned to a specific organization can use that organization's Brokers and org_params. Subscription Topic becomes required after a Source Broker is selected.
5. Troubleshooting Order
- Confirm that both Brokers are enabled and the target Broker reports
RUNNING. - Check
ErrMsg, host, port, credentials, and TLS certificates. - Confirm that the Forwarder rule itself is enabled.
- Confirm that
Subscription Topicmatches the actual message topic. - Temporarily disable the custom script to test transparent forwarding, then inspect the script return value.