https://github.com/daggilli/rabbitmqcpp
Some simple C++ wrappers for the RabbitMQ C library
https://github.com/daggilli/rabbitmqcpp
cpp cpp20 message-queue rabbitmq
Last synced: 10 months ago
JSON representation
Some simple C++ wrappers for the RabbitMQ C library
- Host: GitHub
- URL: https://github.com/daggilli/rabbitmqcpp
- Owner: daggilli
- License: bsd-3-clause
- Created: 2025-06-08T20:53:52.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-06-10T04:26:33.000Z (12 months ago)
- Last Synced: 2025-07-06T11:42:16.638Z (11 months ago)
- Topics: cpp, cpp20, message-queue, rabbitmq
- Language: C++
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RabbitMQ C++ Wrapper
This is a simple set of classes and test harnesses to wrap the RabbitMQ C client API in a C++ interface.
## Prerequisites
A C++20 compiler is required.
The `rabbitmq-c` client library must be installed to provide headers and libraries.
A RabbitMQ server is required. This can be insstalled locally, in a container or on a remote server.
## Build
Run `mkdir build`, then `./CMAKE`, then `./BUILD`. Executables will be created in `build`.
## Namespace
Everything is in a namespace `RabbitMQCpp`.
## Classes
There are two sets of classes, producers and consumers. In each case there is an asbtract base class, `RabbitMQProducer` and `RabbitMQConsumer` respectively.
`RabbitMQProducer` has three derived classes:
- `RabbitMQDirectProducer`
- `RabbitMQPublisher`
- `RabbitMQTopicProducer`
`RabbitMQConsumer` has three derived classes:
- `RabbitMQDirectConsumer`
- `RabbitMQSubscriber`
- `RabbitMQTopicConsumer`
These implement the direct, publish/subscribe abd topic exchanges respectively.
There are three pairs of test harnesses using the three exchange categories:
- `prodicer`/`consumer`
- `publisher`/`subscriber`
- `topicproducer`/`topicconsumer`
## Configuration
The test harnesses are configured by reading a JSON file. This file is parsed by N Lohmann's JSON support library. Installation of this is completely optional but the test harnesses will not work as is without it. A configuration file looks like:
```json
{
"hostname": "",
"username": "",
"password": "",
"vhost": "",
"port":
}
```