This project aims to provide somme common methods to address communication over several message bus. It provide an high level interface to handle comunication of Message. The format of the Message also defined in this project.
It comes today with 2 implementations:
- MQTT
- AMQP
Those 2 implementations are implementing the fty-commom-messagebus2 interface and are carring Message.
The basic idea is to have interface and message working like a post service: Message meta data, defines where to send the message, what's the subject of the message and who send it, etc... (like what you would put in an envelop). Message payload is fully agnostic from the bus (Like what you would put in the envelop). The bus implementation should carry out the message to the destination.
To be valid, a message must have the following fields
- FROM (who send)
- TO (destination queue/topic)
- SUBJECT
If you need someone to reply to your message, you have to add few fields:
- REPLY_TO (which queue/topic to reply)
- CORRELATION_ID (unique id to identify the exchange)
The message definiton is available the header The interfaces is documentation is available in the header
To build fty-common-messagebus2 project run:
cmake -B build -DBUILD_ALL=ON
Equal to
cmake -B build -DBUILD_AMQP=ON -DBUILD_MQTT=ON
To have sample and tests
cmake -B build -DBUILD_SAMPLES=ON -DBUILD_TESTING=ON
And
cmake --build build
Option | description | acceptable value | default value |
---|---|---|---|
BUILD_ALL | Build all addons | ON|OFF | ON |
BUILD_AMQP | Enable AMQP addon | ON|OFF | ON |
BUILD_MQTT | Enable Mqtt addon | ON|OFF | ON |
BUILD_SAMPLES | Enable samples build | ON|OFF | OFF |
BUILD_TESTING | Add test compilation | ON|OFF | ON |
BUILD_DOC | Build documentation | ON|OFF | OFF |
EXTERNAL_SERVER_FOR_TEST | Set a external server only for testing | ON|OFF | OFF |
Add the dependency in CMakeList.txt:
etn_target(${PROJECT_NAME}
SOURCES
.....
USES
.....
fty-common-messagebus2-<amqp|mqtt>
.....
)
See all samples in samples folder
Change log provides informations about bug fixing, improvement, etc.