Erlang bindings for ZeroMQ messaging
C++ Erlang M4 Makefile Shell
Switch branches/tags
Nothing to show
#24 Compare This branch is 26 commits ahead, 2 commits behind saleyn:master.
Latest commit a97f25c Apr 2, 2017 @saleyn saleyn Merge pull request #25 from m4grio/docs
Just a README refresh

Erlang bindings for ZeroMQ


Bindings work against zeromq/ZeroMQ2-x's master branch.

$ git clone
$ cd erlzmq
$ ./bootstrap
$ ./configure --with-zeromq=/path/to/zeromq
$ make

Optionally build the docs:

$ make docs

Usage Samples

  • Sample ZMQ_REQ client
$ erl +K true -smp disable -pa /path/to/zmq/ebin
% Create ZeroMQ context
1> zmq:start_link().

% Create a ZeroMQ REQ socket and specify that messages
% are delivered to the current shell's mailbox.
2> {ok, S} = zmq:socket(req, [{active, true}]).

% Connect to server
3> zmq:connect(S, "tcp://").

% Send a message to server
4> zmq:send(S, <<"Test">>).

% Receive a reply
5> zmq:recv(S).

% Note the error - in the active socket mode we cannot
% receive messages by calling zmq:recv/1. Instead
% use receive keyword to accomplish the task.

6> f(M), receive M -> M end.
% The process blocks because there's no reply from server
% Once you start the server as shown in the following steps
% the receive call returns with the following message:
  • Sample ZMQ_REP server

Start another shell either within the same Erlang VM by using ^G, or in a separate OS shell:

$ erl +K true -smp disable -pa /path/to/zmq/ebin
1> zmq:start_link().
2> {ok, S} = zmq:socket(rep, [{active, false}]).
3> zmq:bind(S, "tcp://").
4> zmq:recv(S).
5> zmq:send(S, <<"Reply">>).

You can run a server and any number of clients in the same Erlang shell or on different nodes.

See for more examples and full documentation. (Content is uploaded from doc/index.html).

Updating documentation on GitHub

$ git checkout master   # make sure you are on master branch
$ make gitdocs          # this will update gh-pages branch and commit changes to origin


BSD License


  • Copyright (c) 2010 Dhammika Pathirana
  • Copywight (c) 2010 Serge Aleynikov



Erlang bindings are released under open-source BSD License (see LICENSE file)