Data Stream Bridge
DataStream (managedBy: System) → Analyzer (optional) → DataStream (managedBy: User) → Bridge / Alert Policy
Overview
The Data Stream Bridge is a one-way integration that forwards selected DataStream values from a WEDA Org to a customer-hosted MQTT broker. It lets you stream WEDA sensor data into your existing SCADA, data lake, or analytics platform without any polling.
Two resource types work together:
| Resource | Purpose |
|---|---|
| MqttBrokerConfig | Connection profile for one MQTT broker (host, port, credentials, protocol version) |
| Bridge | Subscribes to configured NATS bindings by dataStreamId and publishes an assembled JSON payload to MQTT |
Resources
MqttBrokerConfig — MQTT Broker Connection Profile
Stores the connection details for a customer-hosted MQTT broker. One config can be reused by multiple bridges.
Operations
| Operation | API | Description |
|---|---|---|
| Create Broker Config | POST /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs | Register a new broker connection |
| List Broker Configs | GET /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs | List all broker configs in the Org |
| Get Broker Config | GET /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId} | Get one config by ID |
| Update Broker Config | PUT /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId} | Update connection settings (not credentials) |
| Update Credentials | PATCH /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId}/credentials | Rotate the broker's username/password |
| Delete Broker Config | DELETE /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId} | Delete if not in use |
Fields: name, brokerEndpoint, authType (currently UsernamePassword only),
mqttProtocolVersion (V310/V311/V500, default V311), keepAliveInterval/
reconnectInterval (duration strings, e.g. "60s"/"5s", default if omitted), checkConnection
(optional, live-tests the broker at creation/update time).
Credential secrets (username/password) are never returned in clear text — the read model only
exposes hasStoredCredentials: true/false. Rotate credentials with the dedicated
PATCH .../credentials endpoint; the general update endpoint cannot change authType or
credentials.
Deleting a broker config fails (409 DataBridge.BrokerConfigIsBeingUsed) if any bridge still
references it. Delete or repoint all bridges first.
Bridge — Data Bridge Definition
Defines which DataStreams to forward, how to map them into the outgoing MQTT payload, and the delivery assembly policy.
Operations
| Operation | API | Description |
|---|---|---|
| Create Bridge | POST /api/v1/orgs/{orgId}/data-bridges | Define a new bridge |
| List Bridges | GET /api/v1/orgs/{orgId}/data-bridges | List all bridges in the Org |
| Get Bridge | GET /api/v1/orgs/{orgId}/data-bridges/{bridgeId} | Get one bridge by ID |
| Update Bridge | PUT /api/v1/orgs/{orgId}/data-bridges/{bridgeId} | Replace the bridge definition |
| Patch Bridge | PATCH /api/v1/orgs/{orgId}/data-bridges/{bridgeId} | Update select fields |
| Delete Bridge | DELETE /api/v1/orgs/{orgId}/data-bridges/{bridgeId} | Delete a bridge |
| Enable / Disable | POST /api/v1/orgs/{orgId}/data-bridges/{bridgeId}:{action} | Start or stop forwarding |
Bindings
Each binding maps one DataStream (dataStreamId) to a target JSON path
(targetJsonPath) in the outgoing MQTT payload:
Example — a bridge forwarding CPU temperature and AI_0:
{
"mqtt": {
"mqttBrokerConfigId": "{{mqttConfigId}}",
"outputTopic": "factory/site1/cpu"
},
"bindings": [
{ "deviceId": "{{deviceId}}", "dataStreamId": "e033b4b3-36e0-4dbc-a6e4-1e77185402f4", "targetJsonPath": "$.cpuTemp" },
{ "deviceId": "{{deviceId}}", "dataStreamId": "76183372-de00-404c-9081-6ba16f94294d", "targetJsonPath": "$.sensor.ai0" }
]
}
The mqtt object also accepts qos — the MQTT quality-of-service level for outgoing publishes,
0, 1, or 2, defaulting to 0.
Each binding also accepts sourceFieldName (default valueObject), dataType (omit to use the
source payload's type), and requiredForAssembly (default false). The MQTT broker receives one
JSON payload assembled from all bindings each time a batch is published.
Assembly Policy
Controls how the bridge batches DataStream values before publishing. Key settings:
queueLimit (max records before forcing a publish, default 100), timeoutSeconds (wait time
before publishing an incomplete batch, default 5, max 300), and onTimeout (PublishPartial
to send what's available, or DropPartial to discard).
Omit the whole assemblyPolicy object to accept these defaults. If you do supply it on create or
full update, onTimeout is required — sending only queueLimit or timeoutSeconds fails
validation. A PATCH has no such requirement, so you can change one field at a time.
Bridge Lifecycle
A bridge is created disabled (isEnabled: false). Call the enable action to start forwarding —
this performs a live connection check against the linked MQTT broker before the worker starts,
so a bad credential or unreachable broker fails the enable call itself
(400 DataBridge.InvalidBrokerCredentials) rather than failing silently later. Call disable to
stop forwarding and unsubscribe the worker from its NATS bindings; configuration is retained.
Runtime Status
Each bridge reports a runtimeStatus, one of Stopped, Starting, Running, Faulted, or
Stopping. When a bridge is Faulted, inspect the fault object for the cause.
You can sort the bridge list by LastRuntimeStatus, but note it sorts alphabetically by status
name, not by lifecycle order.
The bridge detail response also carries lastPublishTime, queueDepth, and a fault object
(code/message/willRetry/maxRetryAttempts) for live troubleshooting.
fault.code is free-formUnlike runtimeStatus, fault.code has no documented value set. Surface it for humans to read
rather than branching your integration logic on specific fault code strings.
Scenario
A system integrator sets up a bridge to forward a factory device's temperature and AI_0 readings to an on-premises MQTT broker:
Constraints
Broker Config
authType: onlyUsernamePasswordis supported- Credential secrets are never returned in clear text; rotate via the dedicated credentials endpoint
- Cannot be deleted while any bridge still references it (
409 DataBridge.BrokerConfigIsBeingUsed)
Bridge
- Enabling performs a live broker connection check — a bad credential or unreachable broker fails the
enablecall itself - Each
bindings[]entry references adataStreamIddirectly — there is nodataObjectNamelookup step - Bridge names must be unique in the Org (
409 DataBridge.DuplicateBridgeName)
Related
- Understand the source values: DataStreams
- Overview of the Data Engine: Data Engine Concepts