Skip to main content

subscribe-filter-replace

Including the basic AMPS library:

import com.crankuptheamps.client.*;
import com.crankuptheamps.client.exception.*;

Constructing the command:

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

The command can now be used in execute or executeAsync.