Skip to main content

subscribe-bookmark-rate

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 sub id for recovery purposes
.setSubId(subId)

// Start at the recovery point in the bookmark store
.setBookmark(Client.Bookmarks.MOST_RECENT)

// Set options for replay: in this case, maximum of 10,000
// messages/sec for this subscription

.setOptions(Message.Options.Rate("10000"))
;

The command can now be used in execute or executeAsync.