Delta Publish

To delta publish, you use the delta_publish command as follows:

# assumes that client is connected and logged on

msg = ... # obtain changed fields here

client.delta_publish("myTopic", msg)

The message that you provide to AMPS must include the fields that the topic uses to generate the SOW key. Otherwise, AMPS will not be able to identify the message to update. For SOW topics that use a User-Generated SOW Key, use the Command form of delta_publish to set the SowKey, as shown below:

# assumes that client is connected and logged on

msg = ... # obtain changed fields here
key = ... # obtain user-generated SOW key

cmd = AMPS.Command("delta_publish")
cmd.set_topic("delta_topic")
cmd.set_sow_key(key)
cmd.set_data(msg)

# Execute the delta publish. Use None for
# the message handler since any failure acks will
# be routed to the FailedWriteHandler.
client.execute_async(cmd,None)

The full behavior of delta_publish is described in the AMPS User Guide section on Incremental Message Updates.

Last updated