Skip to content

Home

sustrik edited this page · 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.

Prerequisites

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

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

http://www.rabbitmq.com/server.html

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

http://www.zeromq.org/area:download

Installation

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

http://www.rabbitmq.com/admin-guide.html#installing-plugins

Configuration

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:

http://www.rabbitmq.com/install.html#configfile

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

  [{r0mq,
      [{services,
        [{pubsub,
          [{bind, "tcp://127.0.0.1:5555"}],
          [{bind, "tcp://127.0.0.1:5556"}],
          [{exchange, <<"amq.fanout">>}]},
         {pipeline,
          [{bind, "tcp://127.0.0.1:4444"}],
          [{bind, "tcp://127.0.0.1:4445"}],
          [{exchange, <<"pipeline">>}, {queue, <<"pipeline">>}]},
         {reqrep,
          [{bind, "tcp://127.0.0.1:7777"}],
          [{bind, "tcp://127.0.0.1:7778"}],
          [{req_queue, <<"requests">>}]}]}]}].

The general pattern for the R0MQ section is

  {r0mq,
      [{services,
        [{ServiceType,
          [{BindOrConnect, InAddress}, ...],
          [{BindOrConnect, OutAddress}, ...],
          [{OptionKey, OptionValue}, ...]},
         ...]}]}

where

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

0MQ plugin for RabbitMQ maps different messaging patterns — as defined by 0MQ — to different encodings in the AMQP model. To understand exact semantics of each pattern, details of corresponding AMQP encoding and exact semantics of the associated configuration entries, check the pages dedicated to individual patterns:

Something went wrong with that request. Please try again.