Skip to main content

subscribe-bookmark-completed

Including the basic AMPS library:

#include <amps/ampsplusplus.hpp>

Constructing the command:

AMPS::Command cmd(AMPS::Message::Command::Subscribe);
cmd.setTopic(topic);

// Set consistent subId for recovery purposes.
cmd.setSubId(subId);

// Start from the recovery point in the bookmark store
cmd.setBookmark(AMPS::Client::MOST_RECENT());

// Request that the application receive a completed
// acknowledgement when replay completes.

cmd.setAckType(AMPS::Message::AckType::Completed);

The command can now be used in execute or executeAsync.