Skip to main content

On Message Delivered to Subscriber

AMPS provides modules to run actions when AMPS delivers a message to subscribers. The basic flow of AMPS messaging is to first receive a published message, find the subscriber(s) to which this message will be sent, then deliver the message to the subscriber(s).

The amps-action-on-deliver-message runs actions when AMPS delivers a publish message to subscribers.

This module requires the Topic and the MessageType of the message that has been delivered.

ParameterDescription

Topic

(required)

The name of the topic to monitor for message delivery. This parameter supports regular expressions.

There is no default for this parameter.

MessageType

(required)

The message type of the topic to monitor for message delivery.

There is no default for this parameter.

This module adds the following variables to the AMPS context:

VariableDescription
AMPS_TOPICThe topic of the message.
AMPS_DATAThe data the message contains.
AMPS_DATA_LENGTHThe length of the data the message contains.
AMPS_BOOKMARKThe bookmark associated with this message. This is an empty string if the message does not have a bookmark.
AMPS_CLIENT_NAMEThe name of the client to which this message was delivered.
AMPS_CORRELATION_IDThe correlation ID set on the publish command, if one was set.