unsubscribe command
The unsubscribe command allows a client to notify AMPS that it no longer wishes to receive messages related to a previous subscription.
There are two ways that a client can unsubscribe from an existing subscription:
- Adding the
allkeyword to theSubIdheader field in theunsubscribemessage will unsubscribe the client from all AMPS SOW topic subscriptions. - With each
subscriptioncommand issued, AMPS will return aSubIdwith theprocessedacknowledgment message. Issuing anunsubscribecommand using the sameSubIdheader field which was returned as part of the originalsubscribecommand'sprocessedacknowledgment message will unsubscribe a client from a single subscription.
Header Fields
| Field | Description |
|---|---|
cmd | Command to be executed. Value: |
sub_id | Subscription ID entered in AMPS by the client when the original AMPS accepts a single subscription ID or a comma-delimited list of subscription ID. The keyword When both This command requires at least one of the |
query_id | To cancel an in-progress SOW query, the unsubscribe command accepts the Query ID entered in AMPS by the client when the original AMPS accepts a single query ID or a comma-delimited list of query IDs. When both This command requires at least one of the |
ack_type | Acknowledgment type for the given command. Value is a comma separated list of one or more of the following: |
cmd_id | If specified within an AMPS command requesting an acknowledgment message, all requested acknowledgment messages will contain the CommandId in the ack response header. |
Returns
The unsubscribe command supports the received and processed acknowledgment message types, as described in the following table.
| Acknowledgment | Description |
|---|---|
none | No acknowledgment message is returned. This is the default behavior. |
completed | Not supported at this time. |
processed | AMPS has processed the unsubscribe message(s). |
persisted | Not supported at this time. |
received | The unsubscribe message has been received. |
stats | Not supported at this time. |