Skip to content

Commit 9186eaa

Browse files
Merge pull request #11774 from rabbitmq/mergify/bp/v3.13.x/pr-11764
Add stream replication port range in ini-style configuration (backport #11763) (backport #11764)
2 parents 89fc889 + b1ca2a9 commit 9186eaa

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

deps/rabbit/priv/schema/rabbit.schema

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,32 @@ end}.
15711571
{mapping, "proxy_protocol", "rabbit.proxy_protocol",
15721572
[{datatype, {enum, [true, false]}}]}.
15731573

1574+
{mapping, "stream.replication.port_range.min", "osiris.port_range", [
1575+
{datatype, [integer]},
1576+
{validators, ["non_zero_positive_integer"]}
1577+
]}.
1578+
{mapping, "stream.replication.port_range.max", "osiris.port_range", [
1579+
{datatype, [integer]},
1580+
{validators, ["non_zero_positive_integer"]}
1581+
]}.
1582+
1583+
{translation, "osiris.port_range",
1584+
fun(Conf) ->
1585+
Min = cuttlefish:conf_get("stream.replication.port_range.min", Conf, undefined),
1586+
Max = cuttlefish:conf_get("stream.replication.port_range.max", Conf, undefined),
1587+
1588+
case {Min, Max} of
1589+
{undefined, undefined} ->
1590+
cuttlefish:unset();
1591+
{Mn, undefined} ->
1592+
{Mn, Mn + 500};
1593+
{undefined, Mx} ->
1594+
{Mx - 500, Mx};
1595+
_ ->
1596+
{Min, Max}
1597+
end
1598+
end}.
1599+
15741600
%% Whether to stop the rabbit application if a vhost has
15751601
%% to terminate for any reason.
15761602

@@ -2635,7 +2661,6 @@ end}.
26352661
end
26362662
}.
26372663

2638-
% ===============================
26392664
% Validators
26402665
% ===============================
26412666

deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,38 @@ credential_validator.regexp = ^abc\\d+",
10571057
{incoming_message_interceptors, [{set_header_routing_node, false},
10581058
{set_header_timestamp, false}]}
10591059
]}],
1060+
[]},
1061+
1062+
%%
1063+
%% Stream replication port range
1064+
%%
1065+
1066+
{stream_replication_port_range,
1067+
"
1068+
stream.replication.port_range.min = 4000
1069+
stream.replication.port_range.max = 4600
1070+
",
1071+
[{osiris, [
1072+
{port_range, {4000, 4600}}
1073+
]}],
1074+
[]},
1075+
1076+
{stream_replication_port_range,
1077+
"
1078+
stream.replication.port_range.min = 4000
1079+
",
1080+
[{osiris, [
1081+
{port_range, {4000, 4500}}
1082+
]}],
1083+
[]},
1084+
1085+
{stream_replication_port_range,
1086+
"
1087+
stream.replication.port_range.max = 4600
1088+
",
1089+
[{osiris, [
1090+
{port_range, {4100, 4600}}
1091+
]}],
10601092
[]}
10611093

10621094
].

0 commit comments

Comments
 (0)