Skip to main content

subscribe-queue-backlog

Including the basic AMPS library:

#include <amps/ampsplusplus.hpp>

Constructing the command:

AMPS::Command cmd(AMPS::Message::Command::Subscribe);

AMPS::Message::Options opts;

// request a backlog of no more than 100 -- queue may allow a lower number
opts.setMaxBacklog(100);

// Set other options as needed

cmd.setTopic(topic).setOptions(opts);

The command can now be used in execute or executeAsync.