On Message Condition Timeout

AMPS provides a module to run an action when a message in a SOW topic meets a specific condition for longer than a specified period of time. For example, an action might be configured to publish a message to an Alerts topic if an order is unprocessed for more than a specified timeout.

AMPS also provides a module, amps-action-on-alert, that runs when either a message has been in a specific condition for a longer than expected period of time, or the module receives an out-of-focus notification indicating that the message no longer meets the tracking condition. Use that module if both conditions are important. Use this module if it is only important to track timeouts.

The amps-action-on-message-condition-timeout monitors a SOW topic for messages that match a filter and triggers an action for each message that remains matched on that filter for at least the specified duration.

This module uses the Out-of-Focus notification (OOF) mechanism. When a message matches the specified topic and filter, the module begins tracking that message. If no OOF notification is received for that message within the specified timeout, the action runs for that message.

The module tracks each message that matches the filter individually, and will run once for each message that exceeds the timeout.

While the AMPS server is running, this action will trigger exactly once for each message after it reaches the timeout period. When AMPS restarts, if a message that had previously triggered this action still exists in the SOW topic (and still matches the filter provided, if any), the action will run for that message immediately after the module initializes on restart.

This action requires the following parameters. In addition to that, this module also accepts the optional parameters listed below:

Parameter
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 or a conflated topic.

Queues are not supported.

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.

Duration

The amount of time to wait for an OOF notification for the message before running the action.

Filter

Sets the filter to apply.

Only messages that match this filter will be monitored by this action. If no filter is provided, every message of the specified message type in topics that match the Topic value will be monitored.

The module adds the following variables to the AMPS context:

Variable
Description

AMPS_TOPIC

The topic of the message that triggered the alert.

AMPS_DATA

The current data of the message.

AMPS_DATA_LENGTH

The length of the current data of the message, in bytes.

AMPS_BOOKMARK

The bookmark of the message. Empty if there is no bookmark for the message.

AMPS_TIMESTAMP

The timestamp at which the module began tracking the message.

AMPS_CLIENT_NAME

The client name of the current value of the message.

AMPS_SOW_KEY

The current SowKey for the message.

Last updated

Copyright 2013-2024 60East Technologies, Inc.