summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--priv/schema/rabbit.schema21
-rw-r--r--test/config_schema_SUITE_data/rabbit.snippets12
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}]}]}],