diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-08-12 12:48:28 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-08-12 12:48:28 +0100 |
commit | d6530fd55ad5e0850a7f0fb63930c2070187a09c (patch) | |
tree | edd91261e0008fdc197f7bf1c751973c4dcc9d73 /src/rabbit_policies.erl | |
parent | 959a65ae92e47ba2fae416278fefb1cec330c61b (diff) | |
download | rabbitmq-server-d6530fd55ad5e0850a7f0fb63930c2070187a09c.tar.gz |
Max-bytes argument / policy.
Diffstat (limited to 'src/rabbit_policies.erl')
-rw-r--r-- | src/rabbit_policies.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl index 3558cf98..6903c42e 100644 --- a/src/rabbit_policies.erl +++ b/src/rabbit_policies.erl @@ -34,7 +34,8 @@ register() -> {policy_validator, <<"dead-letter-routing-key">>}, {policy_validator, <<"message-ttl">>}, {policy_validator, <<"expires">>}, - {policy_validator, <<"max-length">>}]], + {policy_validator, <<"max-length">>}, + {policy_validator, <<"max-bytes">>}]], ok. validate_policy(Terms) -> @@ -76,6 +77,11 @@ validate_policy0(<<"max-length">>, Value) when is_integer(Value), Value >= 0 -> ok; validate_policy0(<<"max-length">>, Value) -> - {error, "~p is not a valid maximum length", [Value]}. + {error, "~p is not a valid maximum length", [Value]}; +validate_policy0(<<"max-bytes">>, Value) + when is_integer(Value), Value >= 0 -> + ok; +validate_policy0(<<"max-bytes">>, Value) -> + {error, "~p is not a valid maximum number of bytes", [Value]}. |