On Subscribe or Unsubscribe

AMPS provides modules for running actions when a client subscribes or unsubscribes.

The amps-action-on-subscribe runs actions when an AMPS client enters a subscription command. The amps-action-on-unsubscribe runs actions when an AMPS client unsubscribes (either by sending an explicit unsubscribe command or by disconnecting).

These modules require the following parameters:


Topic (required)

Specifies the topic or topic regular expression pattern to monitor for subscribe commands.

MessageType (required)

The message type of the topic to monitor for subscribe or unsubscribe. There is no default for this parameter.

These modules add the following variables to the AMPS context:



The name of the topic specified by the subscribe or unsubscribe command.


The name of the client submitting the command.


The options on the subscription.


The filter for the subscription.

Last updated

Copyright 2013-2024 60East Technologies, Inc.