Purge Channel

The Purge Channel (MQCMD_PURGE_CHANNEL) command stops and purges an IBM MQ telemetry or AMQP channel.

This command can only be issued to channel of type MQTT or AMQP.

Purging a telemetry or AMQP channel disconnects all the MQTT or AMQP clients connect to it, cleans up the state of the MQTT or AMQP clients, and stops the telemetry or AMQP channel. Cleaning the state of a client deletes all the pending publications and removes all the subscriptions from the client.


Required parameters

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

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


Optional parameters

    ChannelType (MQCFIN)
    Channel type (parameter identifier: MQIACH_CHANNEL_TYPE).

    This parameter is required to purge an MQTT channel. It can not be specified for other types of channels. If specified, this parameter must follow immediately after the ChannelName parameter, and the value must be MQCHT_MQTT.

    ClientIdentifier (MQCFST)
    Client identifier (parameter identifier: MQCACH_CLIENT_ID).

    The client identifier is a 23 byte string that identifies an MQ Telemetry Transport or AMQP client. When the Purge Channel command specifies a ClientIdentifier, only the connection for the specified client identifier is purged. If the ClientIdentifier is not specified, all the connections on the channel are purged.

    The maximum length of the string is MQ_CLIENT_ID_LENGTH.

Parent topic: Definitions of the Programmable Command Formats