QueueNado
is a collection of C++ implemntations of ZMQ fast queue patterns (Push/Pull, request/reply, pub/sub, dealer/router) for C++
- g3log
- g3sinks
- FileIO
- ZMQ v3.2.5
- CZMQ v3.0.2
- ZLIB
Most Linux distributions carry zlib.
Example: In Ubuntu it can be installed with
sudo apt-get install zlib1g-dev
- StopWatch
- DeathKnell
- boost For installing boost please follow their instructions.
Example of installation
cd Queuenado
cd 3rdparty
unzip gtest-1.7.0.zip
cd ..
mkdir build
cd build
cmake ..
make -j
sudo ./UnitTestRunneer
sudo make install
Alternative on Debian systems
make package
sudo dpkg -i Queuenado-<package_version>Linux.deb
Rifle - Vampire
implements the push / pull messaging pattern in zmq. The communication setup supports the following client/server communications
Client -to- Server
- one-to-one
- one-to-many
- many-to-one
In a many scenario, it is the "one" side that does the bind
([Vampire.h] [Rifle.h]) on the queue.
It cannot do many-to-many
- Reliable messaging without responses
- High performance (500k msgs per second or higher) with zero_copy
- Process to process communication
Shotgun - Alien
implements the pub / sub messaging pattern in zmq.
- One to many: one sender communicating with many listeners.
- Not high performance around 10k msgs a sec. This can be improved by batching many messages together.
- Process to process communication
- All listeners receive every message sent.
- Slow joiner issues don't matter or can be worked around
Headcrab - Crowbar
implements request / reply messaging pattern in zmq.
- Need to receive acknowledgement from the receiver for each message sent to it
- Know that their will always be a response (otherwise the socket will be broken)
- Lower performance (60k msgs a sec)
Harpoon - Kraken
implements a streaming version of pub / sub. It enables data streaming from a publisher to a subscriber.
The publisher sending streaming data.
Usage example calls from the API: [kraken.h]
-
SendTidalWave()
: Send a data chunk to the subscriber ([harpoon]). The call blocks until there is space available in the queue. ReturnsTIMEOUT
,INTERRUPT
,CONTINUE
status to indicate the status of the underlying queue. -
FinalBreach()
: Call to subscriber ([harpoon]) to indicate the end of a stream.
Usage example calls from the API:
Aim()
: Set location of the queue (tcp)Heave()
: Request data and wait for the data to be returned. ReturnsTIMEOUT
,INTERRUPT
,VICTORIOUS
,CONTINUE
to indicate status of the stream.VICTORIOUS
means that the stream has completed.
[[Kraken.h]] (https://github.com/LogRhythm/QueueNado/blob/master/src/Kraken.h) [KrakenBattle.h] [Harpoon.h] [HarpoonBattle.h]
Notifier - Listener
extends the Shotgun - Alien
implementation of the pub / sub messaging pattern in zmq.
The Notifier - Listener
classes are wrappers around the Shotgun - Alien
queueing framework. A Notifier
is used to place a message onto a queue that is read from by multiple Listeners. It uses handshake communications, where each Listener
must respond back to the Notifier
that it received the message. A Notification
is deemed successful only if every expected Listener
responds to the Notifier
.
- One-to-many with handshake feedback
- Alerting multiple processes of an event, or a call to action
The same as for Shotgun - Alien
The Boomstick - Skeleton
is used for connecting to ElasticSearch over a wrapper. At the moment part of the pattern implementation is not open sourced and still proprietary. Until further notice it is not recommended to use the BoomStick - Skeleton
classes.