Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What library can I use to do simple, lightweight message passing?

I will be starting a project which requires communication between distributed nodes(the project is in C++). I need a lightweight message passing library to pass very simple messages(basically just strings of text) between nodes. The library must have the following characteristics:

  1. No external setup required. I need to be able to get everything up-and-running in my code - I don't want to require the user to install any packages or edit any configuration files(other than a list of IP addresses and ports to connect to).

  2. The underlying protocol which the library uses must be TCP(or if it is UDP, the library must guarantee the eventual receipt of the message).

  3. The library must be able to send and receive arbitrarily large strings(think up to 3GB+).

The library needn't support any security mechanisms, fault tolerance, or encryption - I just need it to be fast, simple, and easy to use. I've considered MPI, but concluded it would require too much setup on the user's machine for my project.

What library would you recommend for such a project? I would roll my own, but due to time constraints, I don't think that will be feasible.

like image 467
Mike Avatar asked Apr 10 '10 20:04

Mike


2 Answers

Take a look at ØMQ, i.e. ZeroMQ.

like image 125
Nikolai Fetissov Avatar answered Nov 09 '22 19:11

Nikolai Fetissov


Apache Qpid implements server and client libraries for Advanced Message Queuing Protocol. It has many features, from which you can use the following:

  1. Client can connect anonymous on the broker, specifying broker's IP/port
  2. Transport protocol is TCP or SCTP
  3. It has support for large messages using either pull style or push style semantics
  4. It's fast
  5. Usage is simple and available in C++:
    • start a broker (or a couple of them, federated)
    • connect with a client and listen in a queue
    • connect with a client and write in a queue
like image 23
clyfe Avatar answered Nov 09 '22 20:11

clyfe