Skip to main content

Data Stream Bridge

Data Engine Pipeline

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:

ResourcePurpose
MqttBrokerConfigConnection profile for one MQTT broker (host, port, credentials, protocol version)
BridgeSubscribes 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

OperationAPIDescription
Create Broker ConfigPOST /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configsRegister a new broker connection
List Broker ConfigsGET /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configsList all broker configs in the Org
Get Broker ConfigGET /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId}Get one config by ID
Update Broker ConfigPUT /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId}Update connection settings (not credentials)
Update CredentialsPATCH /api/v1/orgs/{orgId}/data-bridges/mqtt-broker-configs/{mqttConfigId}/credentialsRotate the broker's username/password
Delete Broker ConfigDELETE /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.

note

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

OperationAPIDescription
Create BridgePOST /api/v1/orgs/{orgId}/data-bridgesDefine a new bridge
List BridgesGET /api/v1/orgs/{orgId}/data-bridgesList all bridges in the Org
Get BridgeGET /api/v1/orgs/{orgId}/data-bridges/{bridgeId}Get one bridge by ID
Update BridgePUT /api/v1/orgs/{orgId}/data-bridges/{bridgeId}Replace the bridge definition
Patch BridgePATCH /api/v1/orgs/{orgId}/data-bridges/{bridgeId}Update select fields
Delete BridgeDELETE /api/v1/orgs/{orgId}/data-bridges/{bridgeId}Delete a bridge
Enable / DisablePOST /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-form

Unlike 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: only UsernamePassword is 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 enable call itself
  • Each bindings[] entry references a dataStreamId directly — there is no dataObjectName lookup step
  • Bridge names must be unique in the Org (409 DataBridge.DuplicateBridgeName)

Last updated on Aug-1, 2026 | Version 1.1.1