Skip to main content

FairCom MQ "deleteTopic"

JSON MQ "deleteTopic" action deletes an MQTT topic

The "deleteTopic" action deletes an MQTT topic.

Important

"deleteTopic" preserves nothing about a topic. This action cannot be undone. It deletes a topic’s configuration, its messages, and the table that stores its messages.

Request examples

Minimal request

{
  "api": "mq",
  "apiVersion": "1.0",
  "authToken": "replaceWithAuthtokenFromCreateSession",
  "action": "deleteTopic",
  "params": {
    "topic": "test/topic1"
  }
}
{
  "api": "mq",
  "apiVersion": "1.0",
  "authToken": "replaceWithAuthtokenFromCreateSession",
  "requestId": "2",
  "action": "deleteTopic",
  "params": {
    "topic": "test/topic2",
    "preserve": "data"
  }
}

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.

{
  "authToken": "authTokenFromCreateSession",
  "result": {},
  "errorCode": 0,
  "errorMessage": ""
}
{
  "authToken": "authTokenFromCreateSession",
  "result": {
  },
  "requestId": "2",
  "debugInfo": {
    "request": {
      "authToken": "authTokenFromCreateSession",
      "api": "mq",
      "action": "deleteTopic",
      "params": {
        "topic": "acmefactory/line1/station1/acidbath/telemetry",
        "preserve": "data"
      },
      "apiVersion": "1.0",
      "requestId": "2",
      "debug": "max"
    },
    "warnings": [
      {
        "code": 14229,
        "message": "Not able to delete topic [acmefactory/line1/station1/acidbath/telemetry] because it was not possible to retrieve its persistence information"
      }
    ]
  },
  "errorCode": 0,
  "errorMessage": ""
}

deleteTopic deletes an MQTT topic

API actionsJSON MQ APIjsonActiondelete topicdeleteTopic

The "params" property is an object that contains an action's parameters. Each action defines its own required and optional properties.

Properties summary

Table 1. "params" properties summary

Property

Description

Default

Type

Limits (inclusive)

preserve

specifies how data, if any, that is associated with the topic is preserved

"nothing"

string

"data"
"nothing"
"table"

topic

specifies a unique user-defined name for the topic

Required - No default value

string

1 to 65,500 bytes



The "preserve" property is an optional, case-insensitive string enum that determines how data, if any, that is associated with an integration table or MQTT topic is preserved. It defaults to "data".

Possible values:
  • "data"

    "data" is the default value, it preserves the entire table and its records.

  • "nothing"

    "nothing" removes the table and its data.

The topic attribute is a unique user-defined name for the topic.

  • The "topic" name may be up to 65,500 characters long, but it is typically less than 150 characters.

  • The "topic" name will be used in all subsequent references to the topic, such as when re-configuring or deleting the topic.