Skip to main content

"deleteBrokerConnection" (jsonAction)

JSON MQ and Hub "deleteBrokerConnection" action deletes connections to external brokers

The "deleteBrokerConnection" action deletes a previously created broker connection. It will not be deleted if the connection is being used by one or more MQTT topics.

  • The "brokerConnectionName" parameter is required.

  • If FairCom's servers cannot delete the broker connection, it will log an error stating, "broker Connection Name xxx cannot be deleted because it is being used by the following topics: xxx, xxx, xxx."

Request examples

Minimal

{
  "api": "mq",
  "action": "deleteBrokerConnection",
  "params": {
    "brokerConnectionName": "MqttBroker1"
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

Note

If the target object does not exist, the response returns success and the debug property contains a warning that the object was not found.

{
  "result": {
  },
  "requestId": "1",
  "debugInfo": {
    "request": {
      "api": "mq",
      "action": "deleteBrokerConnection",
      "params": {
        "brokerConnectionName": "MqttBroker1"
      },
      "requestId": "1",
      "debug": "max",
      "authToken": "replaceWithAuthTokenFromCreateSession"
    },
    "warnings": [
      {
        "code": 100,
        "message": "Broker MqttBroker1 not found"
      }
    ]
  },
  "errorCode": 0,
  "errorMessage": "",
  "authToken": "replaceWithAuthTokenFromCreateSession"
}

deleteBrokerConnection deletes a previously created broker connection

API actionsJSON MQ APIjsonActiondelete broker connectiondeleteBrokerConnectiondeleteBrokerConnectionsdeletesBrokerConnectiondeletesBrokerConnections

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties. See System limits for a comprehensive look at property requirements and limitations.

Table 1. "params" property summaries

Property

Description

Default

Type

Limits (inclusive)

brokerConnectionName

specifies a user-defined unique name for a broker integration

Required - No default value

string

1 to 100 bytes



The "brokerConnectionName" property is a required string that is a unique user-defined name for the connection. It may be up to 100 characters long.

  • The unique name defined in the "brokerConnectionName" property is used in all subsequent references to the connection, such as when configuring a topic to subscribe or forward messages to an external broker or when altering or deleting a broker connection.

  • If the "brokerConnectionName" already exists, FairCom's server will update the record rather than create it.

  • If you do not wish to share a broker connection between multiple topics/integration tables (so you can control the broker connections independently), you can create multiple broker connections which all connect to the same external MQTT broker - giving each broker connection record a different "brokerConnectionName".