Skip to content
Browse files

README: example configuration, todo list

  • Loading branch information...
1 parent 57e9415 commit a8887cfe1472709dba05afa5f366b5a362da4c27 @mabrek committed
Showing with 41 additions and 29 deletions.
  1. +41 −1 README
  2. +0 −28 rabbitmq.config
View
42 README
@@ -15,9 +15,49 @@ 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
View
28 rabbitmq.config
@@ -1,28 +0,0 @@
-%% -*- erlang -*-
-[{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">>}]}]
- ]}]}].

0 comments on commit a8887cf

Please sign in to comment.
Something went wrong with that request. Please try again.