Cookbook: SOW and Subscribe
This section presents common recipes for atomic SOW and Subscribe in AMPS using the Command
or Message
interfaces. This section provides information on how to configure the request to AMPS. You can adapt this information to your application and the specific interface you are using.
Command: sow_and_subscribe
Basic SOW and Subscribe
In its simplest form, a SOW and Subscribe command needs only the topic to query and subscribe to.
SOW and Subscribe with Options
In its simplest form, a SOW and Subscribe command needs only the topic to query and subscribe to. To add options to the subscription, set the Options
header on the Command
.
SOW and Subscribe with Select List
In its simplest form, a SOW and Subscribe command needs only the topic to query and subscribe to. To add options to the subscription, set the Options
header on the Command
. To use a select list, include the specifier for the select list in the options provided.
SOW and Subscribe with Content Filter
To provide a content filter on a SOW and Subscribe command, set the Filter
property on the command. The AMPS User Guide provides details on the filter syntax.
Conflated SOW and Subscribe
To request conflation on the subscription for a SOW and Subscribe command, set the Options
property on the command to specify the conflation interval. When the topic has a SOW (including a view or a conflated topic), there is no need to provide a conflation_key
.
Paginated SOW and Subscribe
To request a paginated subscription for a SOW and Subscribe command, set the Options
property on the command to specify the number of records to return and the number of records to skip before returning records. Most paginated subscriptions also specify the oof
option to be notified when a record is out of focus.
Historical SOW and Subscribe
To create a historical SOW query with a subscription, set the Bookmark
property on the command. The property can be either a specific bookmark or a timestamp. The AMPS User Guide provides details on creating timestamps. This command is only supported on SOW topics that are recorded in an AMPS transaction log.
When History
is enabled for the SOW topic, the Bookmark
provided must be a timestamp or a specific bookmark value, including the special values NOW
(0|1|
) or EPOCH
(0
).
If the Bookmark
provided is a value other than NOW
(0|1|
), the SOW topic must have History
enabled.
Historical SOW and Subscribe with Content Filter
To create a historical SOW query with a subscription, set the Bookmark
property on the command. The property can be either a specific bookmark or a timestamp. The AMPS User Guide provides details on creating timestamps. This command is only supported on SOW topics that are recorded in an AMPS transaction log. If the Bookmark
provided is a value other than NOW (0|1|
), the SOW topic must have History
enabled.
Aggregated SOW and Subscribe
An aggregated SOW and Subscribe command is a command that provides aggregation options. To add these options to the sow_and_subscribe
command, set the Options
header on the Command
.
Last updated