sow_and_subscribe
A sow_and_subscribe
command is used to combine the functionality of sow
and a subscribe
command in a single command.
The sow_and_subscribe
command is used: (a) to query the contents of a SOW topic (this is the sow
command); and (b) to place a subscription such that any messages matching the subscribed SOW topic and query filter will be published to the AMPS client (this is the subscribe
command). As with the subscribe
command, publish
messages representing updates to SOW records are provided for records that match the filter when there is an update published to that record.
Header Fields
The following table contains the header fields supported by a sow_and_subscribe
command.
Returns
A sow_and_subscribe
command returns the following command types:
AMPS will send acknowledgment messages for the following AckType
fields: received
, processed
along with a populated Status
header field describing the acknowledgment message.
If the sow_and_subscribe
command is successful, AMPS will return a group_begin
message to notify the client that a group of messages is being returned as part of the sow
portion of the command.
For more information about SOW topic query behavior, see the chapter on Querying the State of the World in the AMPS User Guide.
The following table contains the AckType
messages that can be returned by a sow_and_subscribe
.
The stats
acknowledgment message includes three values in the header: Matches
, TopicMatches
and the RecordsReturned
. These are defined below:
TopicMatches
The total number of records compared across all matching SOW topics.
Matches
The number of records returned that match the topic regular expression and the content filter. This value can be greater than RecordsReturned
in the case where the number of returned records is limited by TopN
.
RecordsReturned
The total number of records returned to the client, which can be limited by the TopN
header value.
Options Field
The following table contains a list of the Options
available and their definitions when used in the AMPS sow_and_subscribe
command.
Errors
Errors for a sow_and_subscribe
query are returned in the Status
field if an AckType
has been defined. Errors will also be logged in the errors and events log (subject to logging configuration).
Last updated