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:

  1. Adding the all keyword to the SubId header field in the unsubscribe message will unsubscribe the client from all AMPS SOW topic subscriptions.

  2. With each subscription command issued, AMPS will return a SubId with the processed acknowledgment message. Issuing an unsubscribe command using the same SubId header field which was returned as part of the original subscribe command's processed 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

Copyright 2013-2024 60East Technologies, Inc.