Skip to content


sustrik edited this page Sep 14, 2010 · 31 revisions
Clone this wiki locally

0MQ plugin for RabbitMQ

The purpose of this plugin is to provision 0MQ sockets that relay messages into RabbitMQ. Each 0MQ socket type is given an idiomatic encoding in the AMQP broker model, which means AMQP clients can interoperate.

Among other things, this means you can use RabbitMQ as a device in a 0MQ network, gaining rabbity goodness such as persistence and monitoring; and, you can use RabbitMQ as a gateway from 0MQ to other protocols such as AMQP, STOMP or XMPP.


You have to have both RabbitMQ server and 0MQ installed.

For instructions concerning downloading and installation of RabbitMQ Server look here:

For instructions concerning downloading and installation of 0MQ look here:


Copy the files from the downloads section of this repository into the RabbitMQ plugin directory as explained here:


The mapping between 0MQ sockets and exchanges and queues is managed by configuration. Each instance of a mapping is called a “service”.

The configuation file should be located in RabbitMQ configuration directory as explained here:

Here is an example, given as a complete RabbitMQ config file:

          [{bind, "tcp://"}],
          [{bind, "tcp://"}],
          [{exchange, <<"amq.fanout">>}]},
          [{bind, "tcp://"}],
          [{bind, "tcp://"}],
          [{exchange, <<"pipeline">>}, {queue, <<"pipeline">>}]},
          [{bind, "tcp://"}],
          [{bind, "tcp://"}],
          [{req_queue, <<"requests">>}]}]}]}].

The general pattern for the R0MQ section is

          [{BindOrConnect, InAddress}, ...],
          [{BindOrConnect, OutAddress}, ...],
          [{OptionKey, OptionValue}, ...]},


    ServiceType = pubsub
                | pipeline
                | reqrep
    BindOrConnect = bind
                  | connect

and OptionKey will depend on the service type; e.g., for pubsub, it is the exchange to which messages arriving at the inbound socket are published, and from which published messages are send over the outbound socket.


The 0MQ plugin for RabbitMQ supports different types of service (related to the socket types in 0MQ).

Each type of service has an encoding in the AMQP model which allows AMQP clients to participate in the service; for instance, a pubsub service will both relay messages from AMQP clients to 0MQ clients and vice versa (and indeed, AMQP-AMQP and 0MQ-0MQ).

The service types are:

Something went wrong with that request. Please try again.