diff options
| author | Matthew Sackman <matthew@lshift.net> | 2010-04-09 16:09:28 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2010-04-09 16:09:28 +0100 |
| commit | aa49051b35b5bdf14c046f815dbf7db04b531a84 (patch) | |
| tree | d5da9b033a476146419db97a5bb704fd4392c772 /src | |
| parent | 996677caa9cb816415751195d49f34de4116a6dc (diff) | |
| download | rabbitmq-server-git-aa49051b35b5bdf14c046f815dbf7db04b531a84.tar.gz | |
Hide the startup of the msg_stores behind the pluggable API
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_amqqueue.erl | 3 | ||||
| -rw-r--r-- | src/rabbit_backing_queue_type.erl | 7 | ||||
| -rw-r--r-- | src/rabbit_variable_queue.erl | 5 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 235b1edbc7..7a18eb4b67 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -125,7 +125,8 @@ start() -> DurableQueues = find_durable_queues(), - ok = rabbit_queue_index:start_msg_stores(DurableQueues), + {ok, BQ} = application:get_env(backing_queue_module), + ok = BQ:start(DurableQueues), {ok,_} = supervisor:start_child( rabbit_sup, {rabbit_amqqueue_sup, diff --git a/src/rabbit_backing_queue_type.erl b/src/rabbit_backing_queue_type.erl index 46299d0207..b00d351b84 100644 --- a/src/rabbit_backing_queue_type.erl +++ b/src/rabbit_backing_queue_type.erl @@ -35,6 +35,13 @@ behaviour_info(callbacks) -> [ + %% Called on startup with a list of durable queues. The queues + %% aren't being started at this point, but this call allows the + %% backing queue to perform any checking necessary for the + %% consistency of those queues, or initialise any other shared + %% resources. + {start, 1}, + %% Called with queue name and a boolean to indicate whether or %% not the queue is durable. {init, 2}, diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index b798a2c9c4..7ee88deaf8 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -37,6 +37,8 @@ delete_and_terminate/1, requeue/2, tx_publish/2, tx_rollback/2, tx_commit/4, needs_sync/1, handle_pre_hibernate/1, status/1]). +-export([start/1]). + -export([tx_commit_post_msg_store/5, tx_commit_index/1]). %% internal %%---------------------------------------------------------------------------- @@ -252,6 +254,9 @@ %% Public API %%---------------------------------------------------------------------------- +start(DurableQueues) -> + rabbit_queue_index:start_msg_stores(DurableQueues). + init(QueueName, IsDurable) -> PersistentStore = case IsDurable of true -> ?PERSISTENT_MSG_STORE; |
