diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_policies.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl index f48189b210..0faad7259d 100644 --- a/src/rabbit_policies.erl +++ b/src/rabbit_policies.erl @@ -41,6 +41,7 @@ register() -> {policy_validator, <<"expires">>}, {policy_validator, <<"max-length">>}, {policy_validator, <<"max-length-bytes">>}, + {policy_validator, <<"max-priority">>}, {policy_validator, <<"queue-mode">>}, {policy_validator, <<"overflow">>}, {operator_policy_validator, <<"expires">>}, @@ -100,6 +101,12 @@ validate_policy0(<<"max-length-bytes">>, Value) validate_policy0(<<"max-length-bytes">>, Value) -> {error, "~p is not a valid maximum length in bytes", [Value]}; +validate_policy0(<<"max-priority">>, Value) + when is_integer(Value), Value >= 0, Value =< 255 -> + ok; +validate_policy0(<<"max-priority">>, Value) -> + {error, "~p is not a valid max priority (must be an integer in the 1-255 range)", [Value]}; + validate_policy0(<<"queue-mode">>, <<"default">>) -> ok; validate_policy0(<<"queue-mode">>, <<"lazy">>) -> @@ -117,4 +124,3 @@ merge_policy_value(<<"message-ttl">>, Val, OpVal) -> min(Val, OpVal); merge_policy_value(<<"max-length">>, Val, OpVal) -> min(Val, OpVal); merge_policy_value(<<"max-length-bytes">>, Val, OpVal) -> min(Val, OpVal); merge_policy_value(<<"expires">>, Val, OpVal) -> min(Val, OpVal). - |
