unsubscribe
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
all
keyword to theSubId
header field in theunsubscribe
message will unsubscribe the client from all AMPS SOW topic subscriptions.With each
subscription
command issued, AMPS will return aSubId
with theprocessed
acknowledgment message. Issuing anunsubscribe
command using the sameSubId
header field which was returned as part of the originalsubscribe
command'sprocessed
acknowledgment message will unsubscribe a client from a single subscription.
Header Fields
Field
Description
Command
Command to be executed.
Value: unsubscribe
SubId
Subscription ID entered in AMPS by the client when the original subscription
was placed.
AMPS accepts a single subscription ID or a comma-delimited list of subscription ID.
The keyword all
can also be used to unsubscribe from all current subscriptions for the client.
When both SubId
and QueryId
are provided, AMPS removes all matching subscriptions and SOW queries.
This command requires at least one of the SubId
or QueryId
fields to be set.
QueryId
To cancel an in-progress SOW query, the unsubscribe command accepts the Query ID entered in AMPS by the client when the original sow
command was placed.
AMPS accepts a single query ID or a comma-delimited list of query IDs.
When both SubId
and QueryId
are provided, AMPS removes all matching subscriptions and SOW queries.
This command requires at least one of the SubId
or QueryId
fields to be set.
AckType
Acknowledgment type for the given command.
Value is a comma separated list of one or more of the following: none
, received
or persisted
.
CommandId
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.
Last updated