summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAyanda Dube <ayanda.dube@erlang-solutions.com>2015-08-03 18:21:15 +0100
committerAyanda Dube <ayanda.dube@erlang-solutions.com>2015-08-03 18:21:15 +0100
commit585a9690f078d720db62898d04b6405d802bb10c (patch)
tree583ed5b31e7c207fcd9ef89a61620aca956973d2 /src
parenta83a9172d1b39b9f49a50880ee8e63fb8fa71f36 (diff)
downloadrabbitmq-server-git-585a9690f078d720db62898d04b6405d802bb10c.tar.gz
Renames queue-master-location header to x-queue-master-locator
Renames rabbit.queue_master_location config key to rabbit.queue_master_locator References #121
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_queue_location_validator.erl10
-rw-r--r--src/rabbit_queue_master_location_misc.erl14
2 files changed, 12 insertions, 12 deletions
diff --git a/src/rabbit_queue_location_validator.erl b/src/rabbit_queue_location_validator.erl
index d0dc04fbb1..4eab52855a 100644
--- a/src/rabbit_queue_location_validator.erl
+++ b/src/rabbit_queue_location_validator.erl
@@ -25,20 +25,20 @@
[{description, "Queue location policy validation"},
{mfa, {rabbit_registry, register,
[policy_validator,
- <<"queue-master-location">>,
+ <<"x-queue-master-locator">>,
?MODULE]}}]}).
validate_policy(KeyList) ->
- case proplists:lookup(<<"queue-master-location">> , KeyList) of
+ case proplists:lookup(<<"x-queue-master-locator">> , KeyList) of
{_, Strategy} -> validate_strategy(Strategy);
- _ -> {error, "queue-master-location undefined"}
+ _ -> {error, "x-queue-master-locator undefined"}
end.
validate_strategy(Strategy) ->
case module(Strategy) of
R={ok, _M} -> R;
_ ->
- {error, "~p invalid queue-master-location value", [Strategy]}
+ {error, "~p invalid x-queue-master-locator value", [Strategy]}
end.
policy(Policy, Q) ->
@@ -48,7 +48,7 @@ policy(Policy, Q) ->
end.
module(#amqqueue{} = Q) ->
- case policy(<<"queue-master-location">>, Q) of
+ case policy(<<"x-queue-master-locator">>, Q) of
undefined -> no_location_strategy;
Mode -> module(Mode)
end;
diff --git a/src/rabbit_queue_master_location_misc.erl b/src/rabbit_queue_master_location_misc.erl
index c720dc4654..279869d054 100644
--- a/src/rabbit_queue_master_location_misc.erl
+++ b/src/rabbit_queue_master_location_misc.erl
@@ -63,18 +63,18 @@ get_location(Queue=#amqqueue{})->
end.
get_location_mod_by_args(#amqqueue{arguments=Args}) ->
- case proplists:lookup(<<"queue-master-location">> , Args) of
- {<<"queue-master-location">> , Strategy} ->
+ case proplists:lookup(<<"x-queue-master-locator">> , Args) of
+ {<<"x-queue-master-locator">> , Strategy} ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
Reply={ok, _CB} -> Reply;
Error -> Error
end;
- _ -> {error, "queue-master-location undefined"}
+ _ -> {error, "x-queue-master-locator undefined"}
end.
get_location_mod_by_policy(Queue=#amqqueue{}) ->
- case rabbit_policy:get(<<"queue-master-location">> , Queue) of
- undefined -> {error, "queue-master-location policy undefined"};
+ case rabbit_policy:get(<<"x-queue-master-locator">> , Queue) of
+ undefined -> {error, "x-queue-master-locator policy undefined"};
Strategy ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
Reply={ok, _CB} -> Reply;
@@ -83,13 +83,13 @@ get_location_mod_by_policy(Queue=#amqqueue{}) ->
end.
get_location_mod_by_config(#amqqueue{}) ->
- case application:get_env(rabbit, queue_master_location) of
+ case application:get_env(rabbit, queue_master_locator) of
{ok, Strategy} ->
case rabbit_queue_location_validator:validate_strategy(Strategy) of
Reply={ok, _CB} -> Reply;
Error -> Error
end;
- _ -> {error, "queue-master-location undefined"}
+ _ -> {error, "queue_master_locator undefined"}
end.
all_nodes() -> rabbit_mnesia:cluster_nodes(running).