FairMQ/examples/MQ/8-multipart
Dennis Klein 3e013f98b8 refactor and integrate with aliBuild/alienv
* accept ZEROMQ_ROOT as env or cmake variable to hint at install
    location (used by aliBuild/alienv)
  * added more docs
  * fixed mismatch between module name ZeroMQ and prefix of
    generated variables ZMQ -> ZeroMQ is now the preferred prefix
    (old variables are still available and marked deprecated)
  * the aliBuild zeromq recipe does not install zmq.hpp header,
    so the module searches now for the zmq.h header
    (which is anyways the only one we use)
  * some cosmetic changes
  * add option ZeroMQ_NO_DEPRECATION to suppress deprecation warning
2018-05-02 16:12:57 +02:00
..
CMakeLists.txt refactor and integrate with aliBuild/alienv 2018-05-02 16:12:57 +02:00
ex8-multipart-multiple-endpoints.json Convert factory methods to return smart ptrs 2018-05-02 16:12:57 +02:00
ex8-multipart.json Convert factory methods to return smart ptrs 2018-05-02 16:12:57 +02:00
FairMQEx8Header.h Enable new callback API 2018-05-02 16:12:57 +02:00
FairMQExample8Sampler.cxx Enable new callback API 2018-05-02 16:12:57 +02:00
FairMQExample8Sampler.h Enable new callback API 2018-05-02 16:12:57 +02:00
FairMQExample8Sink.cxx Enable new callback API 2018-05-02 16:12:57 +02:00
FairMQExample8Sink.h Enable new callback API 2018-05-02 16:12:57 +02:00
README.md Rename /example to /examples and move MQ examples in it 2018-05-02 16:12:57 +02:00
runExample8Sampler.cxx Update JSON files & readme, use FairMQDevicePtr, cleanup. 2018-05-02 16:12:57 +02:00
runExample8Sink.cxx Update JSON files & readme, use FairMQDevicePtr, cleanup. 2018-05-02 16:12:57 +02:00
startMQEx8.sh.in Modified the ROOTMacros.cmake to allow GENERATE_EXECUTABLE() 2018-05-02 16:12:57 +02:00

Example 8: Sending Multipart messages

A topology of two devices - Sampler and Sink, communicating with PUSH-PULL pattern.

The Sampler sends a multipart message to the Sink, consisting of two message parts - header and body.

Each message part is a regular FairMQMessage. To combine them into a multi-part message, simply send all but the last part with SendPart() and the last part with Send() as shown in the example.

The ZeroMQ transport guarantees delivery of both parts together. Meaning that when the Receive call of the Sink receives the first part, following parts have arrived too.

The header contains a simple data structure with one integer. The integer in this structure is used as a stop flag for the sink. As long as its value is 0, the Sink will keep processing the data. Once its value is 1, the Sink will exit its Run() method.