← All tools

amqp-cpp

Popularity 85 Updated Development & Build

C++ library for communicating with a RabbitMQ message broker

homebrewauto-collected

Installation

Homebrew
brew install amqp-cpp

Install with Homebrew.

AMQP-CPP ========

AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker. The library can be used to parse incoming data from, and generate frames to, a RabbitMQ server.

OVERVIEW ========

Are you upgrading from AMQP-CPP 3 to AMQP-CPP 4? Please read the upgrade instructions

Note for the reader: This readme file has a peculiar structure. We start explaining the pure and hard core low level interface in which you have to take care of opening socket connections yourself. In reality, you probably want to use the simpler TCP interface that is being described later on.

<br

This library has a layered architecture, and allows you - if you like - to completely take care of the network layer. If you want to set up and manage the network connections yourself, the AMQP-CPP library will not make a connection to RabbitMQ by itself, nor will it create sockets and/or perform IO operations. As a user of this library, you create the socket connection and implement an interface defined by AMQP-CPP, passing it to the AMQP-CPP library to use for IO operations.

Intercepting this network layer is optional. The AMQP-CPP library comes with a predefined TCP and TLS module that can be used if you trust the AMQP library to take care of the network (and optional TLS) handling. In that case, the AMQP-CPP library does all the system and library calls to set up network connections, and send/receive the (possibly encrypted) data.

This layered architecture makes the library flexible and portable: it does not necessarily rely on operating system specific IO calls, and can be easily integrated into any kind of event loop. If you want to implement the AMQP protocol on top of some other unusual communication layer, this library can be used for that - but if you want to use it with regular TCP connections, setting it up is just as easy.

AMQP-CPP is fully asynchronous and does not do any blocking (system) calls, so it can be used in high performance applications without the need for threads.

The AMQP-CPP library uses C++17 features, so if you intend to use it, please make sure that your compiler is up-to-date and supports C++17.

TABLE OF CONTENTS =================

  • Overview
  • About
  • How to install
  • How to use AMQP-CPP
  • Parsing incoming data
  • TCP connections
  • Secure connections
  • Existing event loops
  • Heartbeats
  • Channels
  • Channel callbacks
  • Channel errors
  • Flags and Tables
  • Publishing messages
  • Publisher confirms
  • Consuming messages
  • Upgrading
  • Work in progress

ABOUT ===== Back to Table of Contents

This library is created and maintained by Copernica (www.copernica.com), and is used inside the MailerQ (www.mailerq.com) and Yothalot (www.yothalot.com) applications. MailerQ is a tool for sending large volumes of email, using AMQP message queues, and Yothalot is a big data processing map/reduce framework.

Do you appreciate our work and are you looking for high quality email solutions? Then check out our other commercial and open source solutions: