delta_publish command
The delta_publish command is a way of publishing an incremental update to a record. If a client uses delta_publish to publish an update, AMPS first extracts the key fields from the record and does a look up for the record in the SOW. AMPS will then apply the update to the SOW record overwriting any non-key field that has a value in the update and appending to the message any new fields that were not previously in the SOW message.
If delta_publish is used on a record that does not currently exist in the SOW or if it is used on a topic that does not have a SOW topic store defined, then delta_publish will behave like a standard publish command.
A delta_publish is transparent to other clients and the merged record will be forwarded to matching subscriptions.
Header Fields
The following table contains the header fields available to a delta_publish command.
| Field | Description |
|---|---|
cmd | Command to be executed. |
topic | The SOW topic to publish the message to. |
ack_type | Acknowledgment type for the given command. Value is a comma separated list of one or more of the following: none, received, processed, completed or stats. |
cmd_id | If specified with an AMPS command which requests an acknowledgment message, all non-conflated requested acknowledgment messages will contain the command_id in the ack response header. Notice that AMPS may conflate successful persisted acknowledgments for publishes. |
expiration | An interval used to define the lifetime of a |
seq | A monotonically increasing number used to identify published messages in a high availability environment. |
correlation_id | A user-provided string that will be passed, verbatim, to subscribers. If this header is not present, subscribers receive no value for the correlation_id. The contents of this header must consist of characters that are legal in Base64 encoding. |
sow_key | For SOW topics that use an explicit key, the SOW key to use for the message. The contents of this header must consist of characters that are legal in Base64 encoding. |
Returns
For a delta_publish message, AMPS will send acknowledgment messages for the following AckType fields: received, processed and persisted along with a populated Status header field describing the acknowledgment.
The following table contains the acknowledgment messages that can be returned by a delta_publish.
In general, 60East recommends only requesting persisted acknowledgments for delta_publish commands, since these acknowledgments can be conflated when commands succeed.
| Acknowledgment | Description |
|---|---|
none | No |
completed | AMPS has processed the message and, if necessary enqueued the message for persistence and replication. This acknowledgment includes the steps acknowledged by the |
persisted | When AMPS returns an acknowledgment message of
If no replication is configured for this topic, this acknowledgment applies only to local persistence. AMPS may conflate successful persisted acknowledgments to acknowledge multiple publishes at once. In this case, the |
processed | AMPS has processed the message(s) to be published to the SOW. Any errors which occur in the message will be returned to the client in this acknowledgment message. This includes processing entitlement checks, and parsing the message but does not guarantee that the message has been replicated or persisted. |
received | The delta_publish message has been received. |
stats | Not supported at this time. |
Errors
Any errors that occur while processing this command will be returned in the status of a processed acknowledgment message and logged to the log file. Regardless of success or failure, the processed acknowledgment message will be returned only if requested by specifying processed in the AckType field.
Errors that occur during the processing command or after processing the command will be returned in the status of a persisted acknowledgment message if one is requested. This acknowledgment is returned at the point that the message can be considered safely persisted in AMPS. Notice that AMPS may conflate successful persisted acknowledgments for publishes. See the AMPS User Guide for details.