Stop Channel (MQTT)

The Stop Channel (MQCMD_STOP_CHANNEL) command stops an MQ Telemetry channel.


Required parameters

    ChannelName (MQCFST)
    Channel name (parameter identifier: MQCACH_CHANNEL_NAME).

    This parameter is required.

    The name of the channel to be stopped. The maximum length of the string is MQ_CHANNEL_NAME_LENGTH.

    ChannelType (MQCFIN)
    The type of channel (parameter identifier: MQIACH_CHANNEL_TYPE). This parameter is currently only used with MQTT Telemetry channels, and is required when stopping a Telemetry channel. The only value that can currently be given to the parameter is MQCHT_MQTT.


Optional parameters

    ClientIdentifier (MQCFST)
    Client identifier. The client identifier is a 23-byte string that identifies an MQ Telemetry Transport client. When the Stop Channel command specifies a ClientIdentifier, only the connection for the specified client identifier is stopped. If the CLIENTID is not specified, all the connections on the channel are stopped.


Error codes

This command might return the following error codes in the response format header, in addition to the values shown in Error codes applicable to all commands.

    Reason (MQLONG)
    The value can be any of the following values:

      MQRCCF_CHANNEL_DISABLED
      Channel disabled.

      MQRCCF_CHANNEL_NOT_ACTIVE
      Channel not active.

      MQRCCF_CHANNEL_NOT_FOUND
      Channel not found.

      MQRCCF_MODE_VALUE_ERROR
      Mode value not valid.

      MQRCCF_MQCONN_FAILED
      MQCONN call failed.

      MQRCCF_MQOPEN_FAILED
      MQOPEN call failed.

      MQRCCF_MQSET_FAILED
      MQSET call failed.

Parent topic: Definitions of the Programmable Command Formats