Skip to main content

subscribe-filter-replace

Import the AMPS library:

import AMPS

Construct the command:

cmd = AMPS.Command(AMPS.Message.Command.Subscribe)
cmd.set_topic(topic)
cmd.set_sub_id(existingSubId)
cmd.set_filter(newFilter)

# Set other options to match existing subscription
cmd.set_options(AMPS.Message.Options.Replace)

The command can now be used in execute or execute_async.