summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-11-29 12:19:59 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2010-11-29 12:19:59 +0000
commitfc1506364f8f51d57515011f69bac5453d348066 (patch)
tree941d66650849f706aa8c8fb63fade3cde06cd160 /src
parentfb3ba83da55bd4e8169d3c000373e22349014f53 (diff)
downloadrabbitmq-server-git-fc1506364f8f51d57515011f69bac5453d348066.tar.gz
Added mechanism to dynamically choose the backing queue module. Ideally, this'll end up using the generic registry that's part of bug 23467 and allow plugins to register this stuff on boot
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index a999fe582c..87d074c2f6 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -114,12 +114,11 @@ info_keys() -> ?INFO_KEYS.
init(Q) ->
?LOGDEBUG("Queue starting - ~p~n", [Q]),
process_flag(trap_exit, true),
- {ok, BQ} = application:get_env(backing_queue_module),
{ok, #q{q = Q#amqqueue{pid = self()},
exclusive_consumer = none,
has_had_consumers = false,
- backing_queue = BQ,
+ backing_queue = backing_queue_module(Q),
backing_queue_state = undefined,
active_consumers = queue:new(),
blocked_consumers = queue:new(),
@@ -223,6 +222,13 @@ next_state(State) ->
false -> {stop_sync_timer(State2), hibernate}
end.
+backing_queue_module(#amqqueue{arguments = Args}) ->
+ case rabbit_misc:table_lookup(Args, <<"x-mirror">>) of
+ undefined -> {ok, BQM} = application:get_env(backing_queue_module),
+ BQM;
+ _Nodes -> rabbit_mirror_queue_master
+ end.
+
ensure_sync_timer(State = #q{sync_timer_ref = undefined, backing_queue = BQ}) ->
{ok, TRef} = timer:apply_after(
?SYNC_INTERVAL,