Skip to main content

subscribe-bookmark-pause

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)

// Consistent subId for recovery
.setSubId(subId)

// Pause on a specific bookmark: all subscriptions to be
// resumed together should be entered paused at the same
// bookmark.

.setBookmark(pauseBookmark);

// Set "pause" (and any other options needed
.setOptions(Message.Options.Pause)
;

The command can now be used in execute or executeAsync.