summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_queue_location_validator.erl10
-rw-r--r--src/rabbit_queue_master_location_misc.erl14
-rw-r--r--test/src/rabbit_tests.erl8
3 files changed, 16 insertions, 16 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).
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl
index db2e149ec3..4c1489f6aa 100644
--- a/test/src/rabbit_tests.erl
+++ b/test/src/rabbit_tests.erl
@@ -1163,10 +1163,10 @@ test_queue_master_location_policy_validation() ->
OK = fun (JSON) -> ok = Set(JSON) end,
Fail = fun (JSON) -> error = Set(JSON) end,
- OK ("{\"queue-master-location\":\"min-masters\"}"),
- OK ("{\"queue-master-location\":\"client-local\"}"),
- OK ("{\"queue-master-location\":\"random\"}"),
- Fail("{\"queue-master-location\":\"made_up\"}"),
+ OK ("{\"x-queue-master-locator\":\"min-masters\"}"),
+ OK ("{\"x-queue-master-locator\":\"client-local\"}"),
+ OK ("{\"x-queue-master-locator\":\"random\"}"),
+ Fail("{\"x-queue-master-locator\":\"made_up\"}"),
ok = control_action(clear_policy, ["name"]),
passed.