diff options
| author | Alvaro Videla <videlalvaro@gmail.com> | 2015-10-10 17:35:50 +0200 |
|---|---|---|
| committer | Alvaro Videla <videlalvaro@gmail.com> | 2015-10-10 17:35:50 +0200 |
| commit | 78278184dbc5c9269fa28ff2fe80e09df1187dba (patch) | |
| tree | 33e7bacb8d40bb1e5854c003cee07cdb2ea03566 | |
| parent | 63cc2bb9391a34901de50b092f59045b1daf9289 (diff) | |
| download | rabbitmq-server-git-78278184dbc5c9269fa28ff2fe80e09df1187dba.tar.gz | |
adds queue-mode policy
| -rw-r--r-- | src/rabbit_policies.erl | 12 |
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]}. |
