Skip to content

Commit 65ef7b9

Browse files
authored
Merge branch 'main' into willhoy-patch-1
Signed-off-by: Will <2185386+willhoy@users.noreply.github.com>
2 parents 4897a3d + b1a4c6c commit 65ef7b9

65 files changed

Lines changed: 1218 additions & 245 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
#Only run for push to main
2929
if: github.ref == 'refs/heads/main'
3030
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write # Needed to push to gh-pages
3133
steps:
3234
- uses: actions/checkout@v3
3335
- name: Doxygenize

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
cmake_minimum_required(VERSION 3.25)
1+
cmake_minimum_required(VERSION 3.25)
22
project(rmq LANGUAGES C CXX)
33

4+
option(ENABLE_COMPRESSION "Enable zstd compression support" ON)
5+
46
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
57
enable_testing()
68

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ clean:
3232
rm -rf $(BUILD_FOLDER)
3333

3434
docker-setup:
35-
cd $(SRC_FOLDER)/dockerfiles && docker-compose build --pull
35+
cd $(SRC_FOLDER)/dockerfiles && docker compose build --pull
3636

3737
docker-build:
38-
cd $(SRC_FOLDER)/dockerfiles && docker-compose run dev make full
38+
cd $(SRC_FOLDER)/dockerfiles && docker compose run dev make full
3939

4040
docker-test:
41-
cd $(SRC_FOLDER)/dockerfiles && docker-compose run dev make full-test
41+
cd $(SRC_FOLDER)/dockerfiles && docker compose run dev make full-test
4242

4343
docker-shell:
44-
cd $(SRC_FOLDER)/dockerfiles && docker-compose run dev
44+
cd $(SRC_FOLDER)/dockerfiles && docker compose run dev
4545

4646
.PHONY: build init unit integration clean full full-test

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This library has been built from experience learned while supporting other Rabbi
3131
+ `rmqcpp` always declares topology when creating consumers & producers, as per RabbitMQ best practices.
3232
4. ✉ Reliable Message Delivery 'on' by default
3333
+ Publisher confirmations. This ensures clients are aware when messages are owned by RabbitMQ, and avoids messages being silently black holed.
34-
+ Consumer acknowledgements. Switching these on manually helps avoid messages being silently dropped during restart/outages, as would be the case with 'autoack'.
34+
+ Consumer acknowledgements. Switching these on manually helps avoid messages being silently dropped during restart/outages, as would be the case with 'autoack'.
3535
+ Durable queues and persistent delivery mode ensure messages always persist during broker restarts and total datacenter shutdowns.
3636
+ [Mandatory flag](https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish.mandatory) is defaulted to 'true' for all messages to ensure none are silently dropped due to missed bindings.
3737
+ All of the above properties are used by default. Publisher confirms and consumer acknowledgements are required.
@@ -58,7 +58,7 @@ graph TD;
5858
rmqp-->rmqt;
5959
```
6060

61-
**Library** | **Purpose** | **Examples**
61+
**Library** | **Purpose** | **Examples**
6262
:--- | :---- | :----
6363
[rmqp](src/rmq/rmqp) | RabbitMQ library interface (protocol) | Interfaces used to allow testing/mocking of `rmqcpp` applications
6464
[rmqa](src/rmq/rmqa) | RabbitMQ Library interface implementation | The main concrete objects used by applications
@@ -70,7 +70,7 @@ graph TD;
7070

7171
## Quick Start
7272
The quickest way to get started is to take a look at our integration tests and sample 'hello world' program, which is possible by following the Docker [Build](#building) steps and then: from the interactive shell window running `./build/examples/helloworld/rmqhelloworld_producer`
73-
73+
7474

7575
## Usage
7676

@@ -195,7 +195,7 @@ consumer->cancelAndDrain();
195195
196196
## Documentation
197197
Doxygen generated API documentation can be found [here](https://bloomberg.github.io/rmqcpp/index.html)
198-
198+
199199
## Building
200200
201201
### Prerequisites
@@ -206,6 +206,8 @@ Doxygen generated API documentation can be found [here](https://bloomberg.github
206206
207207
There are build configuration options which can be specified using the environment variable `CMAKE_PRESET` (choose from configurations in `CMakePresets.json`) - eg. `export CMAKE_PRESET=macos-arm64-vcpkg`.
208208
209+
`zstd` compression support is enabled by default, and requires the `zstd` library to be installed. To disable this, pass the `-DENABLE_COMPRESSION=OFF` option to cmake.
210+
209211
### Build Steps
210212
Once the prerequisites are configured:
211213
@@ -221,8 +223,8 @@ We also provide Dockerfiles for building and running this in an isolated
221223
environment. If you don't wish to get vcpkg set up on your build machine, this can be an alternative
222224
quick way to get started.
223225
224-
1. `make docker-setup` - Build required base images and setup vcpkg, prerequisite for running commands below
225-
2. `make docker-build` - Build rmqcpp in the container using vcpkg
226+
1. `make docker-setup` - Build required base images and setup vcpkg, prerequisite for running commands below
227+
2. `make docker-build` - Build rmqcpp in the container using vcpkg
226228
3. `make docker-unit` - Build rmqcpp and run unit tests in the container
227229
4. `make docker-shell` - Get an interactive shell within the build environment container
228230

dockerfiles/dev.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ RUN apt-get update && apt-get install -y \
55
clang-format \
66
cmake \
77
curl \
8-
gcc \
8+
gcc \
99
gdb \
1010
git \
1111
libboost-dev \
1212
libssl-dev \
13+
libzstd-dev \
1314
net-tools \
1415
netcat-traditional \
1516
ninja-build \
@@ -24,7 +25,7 @@ RUN apt-get update && apt-get install -y \
2425
zip \
2526
&& rm -rf /var/lib/apt/lists/*
2627

27-
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
28+
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
2829

2930
# clone and install vcpkg
3031
RUN git clone https://github.com/Microsoft/vcpkg.git /build/vcpkg && \

docs/doxygen.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Metric publisher is used to publish internal library metrics. Users can provide
1818

1919
Error callback is called when a connection or channel is closed by the RabbitMQ broker.
2020

21-
Important -- `RabbitContext` object must outlive other library objects (`VHost`, `Producer`, `Consumer`).
21+
**Important** -- `RabbitContext` object **must outlive** other library objects (`VHost`, `Producer`, `Consumer`).
2222

2323
```cpp
2424

@@ -51,6 +51,7 @@ bsl::shared_ptr<rmqa::VHost> vhost = context.createVHostConnection(
5151

5252
Creating a `rmqa::VHost` instance **does not** immediately create a connection with the RabbitMQ broker. These connections are created lazily when calling `rmqa::VHost::createProducer` and `rmqa::VHost::createConsumer`.
5353

54+
**Important** -- `VHost` object **must outlive** other library objects (`Producer`, `Consumer`).
5455

5556
## Topology
5657

examples/rmqperftest/rmqperftest_runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class ConfirmCallback {
8686

8787
void operator()(const rmqt::Message&,
8888
const bsl::string&,
89-
const rmqt::ConfirmResponse&){};
89+
const rmqt::ConfirmResponse&) {};
9090
};
9191

9292
bsl::string_view queueNameOrRoutingKey(bsl::string_view routingKey,

licenses-binary/LICENSE-zstd.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD License
2+
3+
For Zstandard software
4+
5+
Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
* Neither the name Facebook, nor Meta, nor the names of its contributors may
18+
be used to endorse or promote products derived from this software without
19+
specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

licenses/LICENSE-zstd.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD License
2+
3+
For Zstandard software
4+
5+
Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
* Neither the name Facebook, nor Meta, nor the names of its contributors may
18+
be used to endorse or promote products derived from this software without
19+
specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
find_package(Threads REQUIRED) # CMake 3.26-rc3 Bug https://gitlab.kitware.com/cmake/cmake/-/issues/24505
22
find_package(ZLIB REQUIRED)
3+
if (ENABLE_COMPRESSION)
4+
find_package(zstd CONFIG REQUIRED)
5+
endif()
36
find_package(Boost REQUIRED)
47
set(OPENSSL_USE_STATIC_LIBS TRUE)
58
find_package(OpenSSL REQUIRED)

0 commit comments

Comments
 (0)