Skip to content

JeffersonLab/xmsg-cpp

Repository files navigation

xMsg

xMsg is a lightweight, yet full featured publish/subscribe messaging system, presenting asynchronous inter-process communication.

Build Status API reference

Overview

xMsg actors are required to publish and/or subscribe to messages. The messages are identified by topics, and contain metadata and user-serialized data. xMsg topic convention defines three parts: domain, subject, and type. The data is identified by the mime-type metadata field, which can be used by applications to deserialize the raw bytes into its proper data-type object.

Multi-threaded publication of messages is supported, with each thread using its own connection to send messages. Subscriptions run in a background thread, and each received message is processed by a user-defined callback executed by a thread-pool. Note that the provided callback must be thread-safe.

A proxy must be running in order to pass messages between actors. Messages must be published to the same proxy than the subscription, or the subscriber will not receive them. Long-lived actors can register with a global registrar service if they are periodically publishing or subscribed to a given topic, and others actors can search the registrar to discover them.

Documentation

The reference documentation is available at https://claraweb.jlab.org/xmsg/.

Build notes

xMsg requires a C++14 compiler and CMake 3.5+

Ubuntu 18.04 and 20.04

Install GCC and CMake from the repositories:

$ sudo apt install build-essential cmake

Mac OS X 10.9 and newer

Install Xcode command line tools:

$ xcode-select --install

Install CMake using Homebrew:

$ brew install cmake

Dependencies

xMsg uses Protocol Buffers and ZeroMQ.

Ubuntu 18.04 and 20.04

Install from the repositories:

$ sudo apt install libzmq5-dev libprotobuf-dev protobuf-compiler

macOS

Use Homebrew:

$ brew install zeromq protobuf

Installation

To build with CMake a configure wrapper script is provided:

$ ./configure --prefix=<INSTALL_DIR>
$ make
$ make install

When installing as a dependency for CLARA, the <INSTALL_DIR> prefix should be preferably $CLARA_HOME.

Authors

  • Vardan Gyurjyan
  • Sebastián Mancilla
  • Ricardo Oyarzún

For assistance send an email to [email protected].