Skip to main content

Cookbook: Delta Publishing

This section presents common recipes for publishing to a topic 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: delta_publish

Basic Delta Publish

In its simplest form, a delta publish needs only the topic to publish to and the data to publish. The AMPS client automatically constructs the necessary AMPS headers and formats the full delta_publish command.

In many cases, a publisher only needs to use the basic delta publish command.

HeaderComment
topic

(required)
Sets the topic to publish to. The topic specified must be a literal topic name. Regular expression characters in the topic name are not interpreted. Some topics in AMPS, such as views and conflated topics, cannot be published to directly. Instead, a publisher must publish to the underlying topics.
dataThe data to publish to the topic. The AMPS client does not interpret, escape, or validate this data: the data is provided to the server verbatim.

Delta Publish with CorrelationId

AMPS provides publishers with a header field that can be used to contain arbitrary data, the correlation_id. A delta publish message can be used to update the correlation_id as well as the data within the message.

HeaderComment
topic

(required)
Sets the topic to publish to. The topic specified must be a literal topic name. Regular expression characters in the topic name are not interpreted. Some topics in AMPS, such as views and conflated topics, cannot be published to directly. Instead, a publisher must publish to the underlying topics.
dataThe data to publish to the topic. The AMPS client does not interpret, escape, or validate this data: the data is provided to the server verbatim.
correlation_idThe correlation_id to provide on the message. AMPS provides the correlation_id to subscribers. The correlation_id has no significance for AMPS. The correlation_id may only contain characters that are valid in base-64 encoding.

Delta Publish with Explicit SOW Key

When publishing to a SOW topic that is configured to require an explicit SOW Key, the publisher needs to set the sow_key header on the message.

HeaderComment
topic

(required)
Sets the topic to publish to. The topic specified must be a literal topic name. Regular expression characters in the topic name are not interpreted. Some topics in AMPS, such as views and conflated topics, cannot be published to directly. Instead, a publisher must publish to the underlying topics.
dataThe data to publish to the topic. The AMPS client does not interpret, escape, or validate this data: the data is provided to the server verbatim.
sow_keyThe SOW Key to use for this message. This header is only supported for publishes to a topic that requires an explicit SOW Key.