Skip to main content

subscribe-filter-replace

Importing the AMPS client library:

using AMPS.Client;
using AMPS.Client.Exceptions;

Constructing the command:

Command cmd = new Command(Message.Commands.Subscribe)
.setTopic(topic)
.setSubId(existingSubId)
.setFilter(filter)
.setOptions(Message.Options.Replace
// + other options to match existing subscription
)
;

The command can now be used in execute or executeAsync.