Delta Publish

To delta publish, you use the Client.deltaPublish() method as follows:

const data = ... ;  // obtain changed fields here
client.deltaPublish('my-topic', data);

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:

const data = ... ;  // obtain changed fields here
const key = ... ;   // obtain user-generated SOW key

const command = new Command('delta_publish');
command.topic('delta-topic');
command.sowKey(key);
command.data(data);

/**
* Execute the delta publish. Do not provide a message
* handler since delta_publish is not waiting for the
* acknowledgment from the server.
*/
client.execute(command);

Last updated