On SOW Message Expiration
Last updated
Last updated
Copyright 2013-2024 60East Technologies, Inc.
AMPS provides a module to run an action when a message expires from a topic in the SOW.
The amps-action-on-sow-expire-message
module monitors a topic for expirations. The action runs once for each message that expires in the matching topic. Notice, in particular, that this includes monitoring messages that expire from the queue, which are presented as SOW expirations to this module.
This action requires the following parameters. In addition to that, this module also accepts an optional parameter listed below:
Parameter | Description |
---|---|
The module adds the following variables to the AMPS context:
Variable | Description |
---|---|
Topic
(required)
The name of the topic to monitor for messages.
This parameter does not support regular expressions. The topic name must be either a SOW topic, a view, a conflated topic or a queue.
There is no default for this parameter.
MessageType
(required)
The message type of the topic to monitor for messages.
There is no default for this parameter.
Reason
An optional comma-delimited string indicating the expiration reasons to monitor for.
For example, setting this to time_limit,forced_expire
will cause this action to be invoked only when the expiration reason includes one of time_limit
or forced_expire
.
For more information on the allowed values and definitions, see the documentation for AMPS_REASON
below.
AMPS_TOPIC
The topic of the message that expired.
AMPS_DATA
The current data of the message.
AMPS_DATA_LENGTH
The length of the current data of the message, in bytes.
AMPS_REASON
A comma-delimited string indicating one or more reason(s) the message was expired.
This string contains one or more of the following values:
time_limit
- the expiration time for this message or topic has passed.
forced_expire
- this queue message was acknowledged with an expire
option resulting in the message's immediate removal.
max_cancels
- this queue message was acknowledged with a cancel
option and the number of cancels exceeded the queue's configured MaxCancels
limit.
max_deliveries
- this queue message was not successfully acknowledged by a subscriber and the number of deliveries has exceeded the queue's MaxDeliveries
limit.
AMPS_CORRELATION_ID
The correlation ID set on the publish command if one was set.