Cookbook: Publish
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: publish
The AMPS server does not return a stream of messages in response to a publish
command.
AMPS publish
commands do not return a stream of messages. A publish command must be used with asynchronous message processing and should typically pass an empty message handler.
Basic Publish
In its simplest form, a 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 publish
command.
In many cases, a publisher only needs to use the basic publish
command.
Publish with CorrelationId
AMPS provides publishers with a header field that can be used to contain arbitrary data, the CorrelationId
.
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 SowKey
header on the message.
Last updated