Publish Message

The amps-action-do-publish-message module publishes a message into a specified topic.

Publishes from this action are treated as publishes from an AMPS client inside the AMPS engine. This means that:

  • There are no user credentials associated with the publish, so entitlements are not applied.

  • There is no special handling for the publish. The publish is recorded in the transaction log exactly as if it arrived from outside of the instance and is processed within the instance as if the publish had arrived from an external publisher.

This action is treated by the AMPS engine as a publish from an internal AMPS client. When an amps-action-do-publish-message runs in response to the amps-action-on-publish-message event or the amps-action-on-deliver-message event, use caution, the message published from this action could cause the event to trigger again.

This warning includes cases where the action publishes to a topic directly monitored by the action and cases where the action monitors a view and publishes to an underlying topic of the view. The warning also applies to configurations in which two or more actions "cross publish" to topics that are monitored by the other action. An example of the last case is an action that monitors TopicOne and publishes to TopicTwo, while another action monitors TopicTwo and publishes to TopicOne.

The result of a configuration like the ones described above is called a publish loop. AMPS does not support unterminated publish loops or loops that produce a large number of cycles before terminating.

To publish a message, this module requires a Topic, the MessageType to publish on and also the Data that the message will contain. In addition to that, this module also accepts optional parameters listed below:

This module does not add any variables to the AMPS context.

Last updated

Copyright 2013-2024 60East Technologies, Inc.