Version 2.0 of the AMQP-CPP has a fundamental different API compared to the 1.0.* branche. Unlike the 1.0.* versions, AMQP-CPP no longer offers an abstract ChannelHandler class. Most channel methods now return a "Amqp::Deferred" object instead. This is an object that represents a AMQP operation-in-progress, and on which callback methods can be set using methods like onSuccess() and onError(). This allows one to use C++11 type lambda functions to handle success and errors:
channel.declareExchange("my-exchange").onSuccess([]() {
// @todo handle the creation of the exchange
}).onError([](const char *message) {
// @todo handle failure
});Also a number of bugs have been solved, and for synchronous AMQP instructions the AMQP-CPP client now first waits for the answer to come in, before subsequent instructions are sent to the RabbitMQ broker.