Message Functions
AMPS includes functions that can be used to refer to the current message being processed.
Function | Parameters | Description | Available For |
---|---|---|---|
| (none) | Returns the size of the payload of the current message, in bytes. | All messages |
| (none) | Returns the correlation ID of the current message as a string. Returns NULL if there is no correlation ID for the current message. | All messages |
| (none) | Returns a timestamp for the last time that a message in the SOW was updated, as a double. For a subscription (including the subscription part of a Notice that this field is set based on when the local instance has updated the message. For replicated topics, this means that a given message will have different values on different instances. | Queries of a SOW topic |
| (none) | Returns the bookmark for the current message, if one is available.
Notice that messages retrieved from a SOW topic using a query return NULL for Bookmarks are assigned using a combination of an identifier derived from the client name and a sequence number. When working with bookmarks, 60East recommends treating bookmarks as opaque identifiers. In particular, bookmarks are not guaranteed to sort in any particular order between different publishers. AMPS only assigns bookmarks when a message is stored in the transaction log. Messages that are not in the transaction log do not have bookmarks assigned. | Subscriptions to a transaction-logged topic Bookmark subscriptions Subscriptions to a message queue Replication filters |
| (none) | Returns the topic name for the message currently being processed. When used in a filter for a message being delivered from a queue that has multiple underlying topics, returns the name of the underlying topic. | All messages |
| (none) | Returns the SOW key for the message currently being processed, if one exists. This function is designed for use in enrichment. In a query, subscription, or delete command, using the | Queries or enrichment of a SOW topic Subscriptions to a SOW topic |
| (none) | Returns a hash value of the SOW key for the message currently being processed. If AMPS generated the SOW key, this value will be the same value as the SOW key. For topics where the publisher provides the SOW key, this will be a hash of the value provided by the publisher. This function is designed for use in enrichment. | Queries or enrichment of a SOW topic Subscriptions to a SOW topic |
| (none) | Returns a timestamp for the last time that this message was read from the SOW, as a double. This function only returns a value for messages in a topic in the SOW. The Notice that this field is set based on when the local instance processes a read of the message. For replicated topics, this means that a given message will have different values on different instances. This function is non-deterministic, and cannot be used in contexts that require a deterministic function. | Queries of a SOW topic |
| (none) | For a message in a queue, returns a timestamp for the last time this message was leased from this instance, as a double. Returns Notice that this timestamp is set based on when the local instance leased the message. This counter is reset when the instance restarts. | Queries of a message queue Subscription to a message queue SOW delete by filter for a message queue |
| (none) | For a message in a queue, returns the number of times the message has been leased from this instance as a double. Returns Notice that this counter is set based on leases from the local instance. This counter is reset when the instance restarts, and does not track leases from other instances. | Queries of a message queue Subscription to a message queue SOW delete by filter for a message queue |
When used in view construction or aggregate definition, these functions refer to the incoming message that is prompting the update to the view or aggregate, not to the constructed message that is the result of the update. For example, a Field
like this in a view projection:
will return the topic name of the topic that prompted the update to the view, not the name of the view itself.
Last updated