diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2017-10-21 23:48:08 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2017-10-22 05:12:09 +0300 |
| commit | 4c5ebd99fc3cae32e71d06a761518fe0e221a536 (patch) | |
| tree | e81a8807d10506f4638da0129be7c5e56b96e15e | |
| parent | 08700282b7176d62cb262a66eceb576610d66c4d (diff) | |
| download | rabbitmq-server-git-4c5ebd99fc3cae32e71d06a761518fe0e221a536.tar.gz | |
Support rabbit.connection_max in Cuttlefish schema
| -rw-r--r-- | priv/schema/rabbit.schema | 21 | ||||
| -rw-r--r-- | test/config_schema_SUITE_data/rabbit.snippets | 12 |
2 files changed, 32 insertions, 1 deletions
diff --git a/priv/schema/rabbit.schema b/priv/schema/rabbit.schema index 734a8a4102..9a0d54a2ad 100644 --- a/priv/schema/rabbit.schema +++ b/priv/schema/rabbit.schema @@ -523,10 +523,29 @@ end}. %% Set the max permissible number of channels per connection. %% 0 means "no limit". %% -%% {channel_max, 128}, +%% {channel_max, 0}, {mapping, "channel_max", "rabbit.channel_max", [{datatype, integer}]}. +%% Set the max permissible number of client connections per node. +%% `infinity` means "no limit". +%% +%% {connection_max, infinity}, + +{mapping, "connection_max", "rabbit.connection_max", + [{datatype, [{atom, infinity}, integer]}]}. + +{translation, "rabbit.connection_max", + fun(Conf) -> + case cuttlefish:conf_get("connection_max", Conf, undefined) of + undefined -> cuttlefish:unset(); + infinity -> infinity; + Val when is_integer(Val) -> Val; + _ -> cuttlefish:invalid("should be a non-negative integer") + end + end +}. + %% Customising Socket Options. %% %% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for diff --git a/test/config_schema_SUITE_data/rabbit.snippets b/test/config_schema_SUITE_data/rabbit.snippets index 233eb8a55b..f978ee0b41 100644 --- a/test/config_schema_SUITE_data/rabbit.snippets +++ b/test/config_schema_SUITE_data/rabbit.snippets @@ -151,6 +151,18 @@ tcp_listen_options.exit_on_close = false", [{rabbit, [{vm_memory_calculation_strategy, legacy}]}], []}, + {connection_max, + "connection_max = 999", + [{rabbit,[{connection_max, 999}]}], + []}, + {connection_max, + "connection_max = infinity", + [{rabbit,[{connection_max, infinity}]}], + []}, + {channel_max, + "channel_max = 16", + [{rabbit,[{channel_max, 16}]}], + []}, {listeners_tcp_ip, "listeners.tcp.1 = 192.168.1.99:5672", [{rabbit,[{tcp_listeners,[{"192.168.1.99",5672}]}]}], |
