Cookbook: SOW and Delta Subscribe
This section presents common recipes for atomic SOW and Delta 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_delta_subscribe
Basic SOW and Delta Subscribe
In its simplest form, a SOW and Delta Subscribe needs only the topic to query and subscribe to.
Header | Comment |
---|---|
| Sets the topic to query and subscribe to. The topic specified can be the literal topic name, or a regular expression that matches multiple topics. |
SOW and Delta Subscribe with Options
In its simplest form, a SOW and Delta Subscribe needs only the topic to query and subscribe to. To add options to the subscription, set the Options
header on the Command
.
Header | Comment |
---|---|
| Sets the topic to query and subscribe to. The topic specified can be the literal topic name, or a regular expression that matches multiple topics. |
opts | A comma-delimited set of options for this command. See the
|
SOW and Delta Subscribe with Content Filter
To provide a content filter on a SOW and Delta Subscribe, set the Filter
property on the command. The AMPS User Guide provides details on the filter syntax.
Header | Comment |
---|---|
| Sets the topic to query and subscribe to. The topic specified can be the literal topic name, or a regular expression that matches multiple topics. |
filter | Sets the content filter to be applied to the query. Only messages that match the content filter will be returned in response to the query. |
Paginated SOW and Delta Subscribe
To request a paginated subscription for a SOW and Delta Subscribe, 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.
Header | Comment |
---|---|
| Sets the topic to query and subscribe to. The topic specified can be the literal topic name, or a regular expression that matches multiple topics. |
orderby | Specifies how to order the results within the paginated result set. If the OrderBy is not provided, the results are ordered by the SowKey for the messages. |
opts | A comma-separated list of options for the command. Set the number of results returned with |
Aggregated SOW and Delta Subscribe
An Aggregated SOW and Delta Subscribe is a command that provides aggregation options. To add these options to the command, set the Options
header on the Command
.
Header | Comment |
---|---|
| Sets the topic to query and subscribe to. The topic specified can be the literal topic name, or a regular expression that matches multiple topics. |
opts | A comma-delimited set of options for this command. For an aggregated SOW and delta subscribe, the options provide the
|