summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_policies.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl
index 65f3801e3e..a4e1e9be4a 100644
--- a/src/rabbit_policies.erl
+++ b/src/rabbit_policies.erl
@@ -35,7 +35,8 @@ register() ->
{policy_validator, <<"message-ttl">>},
{policy_validator, <<"expires">>},
{policy_validator, <<"max-length">>},
- {policy_validator, <<"max-length-bytes">>}]],
+ {policy_validator, <<"max-length-bytes">>},
+ {policy_validator, <<"queue-mode">>}]],
ok.
validate_policy(Terms) ->
@@ -83,4 +84,11 @@ validate_policy0(<<"max-length-bytes">>, Value)
when is_integer(Value), Value >= 0 ->
ok;
validate_policy0(<<"max-length-bytes">>, Value) ->
- {error, "~p is not a valid maximum length in bytes", [Value]}.
+ {error, "~p is not a valid maximum length in bytes", [Value]};
+
+validate_policy0(<<"queue-mode">>, <<"default">>) ->
+ ok;
+validate_policy0(<<"queue-mode">>, <<"lazy">>) ->
+ ok;
+validate_policy0(<<"queue-mode">>, Value) ->
+ {error, "~p is not a valid queue-mode value", [Value]}.