Skip to main content
Version: Next

MQTT API for Bridges

Control topic

The plugins can be controlled by sending command messages to a topic. Responses are also published to the topic followed by /response. The topic depends on the bridge, you are trying to configure or request infos about:

BridgeTopicResponse Topic
Azure Bridge$CONTROL/cedalo/azure-eventhubs-bridge/v1$CONTROL/cedalo/azure-eventhubs-bridge/v1/response
Influx DB Bridge$CONTROL/cedalo/influxdb-bridge/v1$CONTROL/cedalo/influx-db/v1/response
Mongo DB Bridge$CONTROL/cedalo/mongodb-bridge/v1$CONTROL/cedalo/mongo-db/v1/response

The following commands are currently available:

  • getSchema to get the schemata used to validate the config JSON
  • getConfig to fetch current config as a JSON object
  • updateConfig to update the complete configuration of the Azure EventHubs Bridge
  • getStatus to fetch information about current bridge status

Each control message has the following format:

{
"commands": [
{
"command": <A known control api command>,
"correlationData": <Optional UUID to identify sender. If specified it is passed with response.>,
"configChange": <Valid config JSON object>
}
]
}

getConfig

For example to fetch the current config send a getConfig command:

{
"commands": [
{
"command": "getConfig",
"correlationData": "1234"
}
]
}

The response depends on the type of bridge.

updateConfig

And to update it use the updateConfig command. The content of the configChange depends on the bridge, you are trying to configure and is explained in detail in the specific bridge explanation below the Bridges Section. In the examole below, the Azure Eventhub Bridge in configured.

{
"commands": [
{
"command": "updateConfig",
"correlationData": "12345",
"configChange": {
"eventhubs": [
{
"name": "EvHub1",
"auth": {
"sas": {
"key": "A_SAS_Key_Token"
}
}
}
],
"producers": [
{
"name": "P1",
"hub": "hub1",
"eventhub": "EvHub1",
"options": {
"messageId": "{NOW_ISO}"
}
}
],
"topicMappings": [
{
"source": "test/topic",
"target": "P1"
}
]
}
}
]
}

getSchema

Example of getSchema:

{
"commands": [
{
"command": "getSchema",
"correlationData": "1234"
}
]
}

The response depends on the type of bridge and is explained in detail in the specific bridge explanation below the Bridges Section

Example of getStatus:

{
"commands": [
{
"command": "getStatus",
"correlationData": "1234"
}
]
}

The response depends on the type of bridge and is explained in detail in the specific bridge explanation below the Bridges Section