GithubHelp home page GithubHelp logo

rabbitmq-redis's Introduction

Experimental bridge between RabbitMQ and Redis implemented as a RabbitMQ plugin.

Introduction
------------

This plugin moves messages between RabbitMQ and Redis Pub/Sub (http://redis.io/topics/pubsub) using erldis.
It was inspired by RabbitMQ-shovel and shares the same idea with the exception 
that it connects Redis pub/sub channels to RabbitMQ queues or exchanges.

For building see instructions at:
http://www.rabbitmq.com/plugin-development.html

Configuration
-------------

The plugin is configured using rabbitmq.config file that has a structure 
like this:
[{rabbit, [rabbit-settings]},
 {rabbit_redis, [rabbitmq-redis-plugin-settings]}
].

Example of rabbitmq.config with rabbitmq-redis plugin:
[{rabbit_redis, 
  [{bridges, [
% subscribes to redis channel "foo" and publishes all received messages 
% to rabbitmq exchange "quux" with routing_key equals to redis channel ("foo")
              [{name, subsribe_bridge},
               {type, subscribe},
               {redis, [{host, "localhost"},
                        {port, 6379},
                        {channels, [<<"foo">>]}]},
               {rabbit, [{declarations, [{'exchange.declare',
                                          [{exchange, <<"quux">>},
                                           auto_delete
                                          ]}]},
                         {publish_fields, [{exchange, <<"quux">>}]}]}],
% consumes messages from rabbitmq queue "foo" and publishes them 
% to redis channel with name equals to message routing_key
              [{name, publish_bridge},
               {type, publish},
               {redis, [{host, "localhost"},
                        {port, 6379}]},
               {rabbit, [{declarations, [{'queue.declare', 
                                          [{queue, <<"foo">>},
                                           auto_delete]}]},
                         {bindings, [{'queue.bind', 
                                          [{queue, <<"foo">>},
                                           {exchange, <<"quux">>},
                                           {routing_key, <<"foo">>}]}]},
                         {queue, <<"foo">>}]}]
             ]}]}].

Note that this configuration will create short-circuit for messages 
in queue "foo" making them bounce between rabbit and redis infinitely.


TODO
----

 - handle redis connection failures
 - handle rabbit channel flow events
 - support psubscribe redis command
 - consider merging with rabbitmq-shovel

rabbitmq-redis's People

Contributors

mabrek avatar

Stargazers

Bob Jordan avatar Omer Katz avatar ozkan avatar Trevor Joynson avatar Grace avatar Alex Martynov avatar zhaoweiguo avatar David.Gao avatar autoscatto avatar Lincoln Clarete avatar Tim Spann avatar Mathieu M-Gosselin avatar Jonno avatar  avatar Michaël MEMETEAU avatar Anderson Santos avatar Mikhail Mangushev avatar Colin Kuo avatar  avatar thinkphper avatar Adriano Santos avatar Stefano Tamagnini avatar Piotr Sikora avatar James Socol avatar Oliver Eilhard avatar  avatar Michael Bridgen avatar Daniel Podlejski avatar Almad avatar Gus Becciu avatar Dominik Sander avatar Renaud Morvan avatar Matt Biddulph avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.