Add stream replication port range in ini-style configuration
This is more straightforward than configuring Osiris in the advanced configuration file.
This commit is contained in:
parent
7ac5e89c51
commit
eeb35d2688
|
@ -2665,6 +2665,31 @@ fun(Conf) ->
|
|||
list_to_binary(cuttlefish:conf_get("amqp1_0.default_vhost", Conf))
|
||||
end}.
|
||||
|
||||
{mapping, "stream.replication.port_range.min", "osiris.port_range", [
|
||||
{datatype, [integer]},
|
||||
{validators, ["non_zero_positive_integer"]}
|
||||
]}.
|
||||
{mapping, "stream.replication.port_range.max", "osiris.port_range", [
|
||||
{datatype, [integer]},
|
||||
{validators, ["non_zero_positive_integer"]}
|
||||
]}.
|
||||
|
||||
{translation, "osiris.port_range",
|
||||
fun(Conf) ->
|
||||
Min = cuttlefish:conf_get("stream.replication.port_range.min", Conf, undefined),
|
||||
Max = cuttlefish:conf_get("stream.replication.port_range.max", Conf, undefined),
|
||||
|
||||
case {Min, Max} of
|
||||
{undefined, undefined} ->
|
||||
cuttlefish:unset();
|
||||
{Mn, undefined} ->
|
||||
{Mn, Mn + 500};
|
||||
{undefined, Mx} ->
|
||||
{Mx - 500, Mx};
|
||||
_ ->
|
||||
{Min, Max}
|
||||
end
|
||||
end}.
|
||||
|
||||
% ===============================
|
||||
% Validators
|
||||
|
|
|
@ -1057,6 +1057,38 @@ credential_validator.regexp = ^abc\\d+",
|
|||
{incoming_message_interceptors, [{set_header_routing_node, false},
|
||||
{set_header_timestamp, false}]}
|
||||
]}],
|
||||
[]},
|
||||
|
||||
%%
|
||||
%% Stream replication port range
|
||||
%%
|
||||
|
||||
{stream_replication_port_range,
|
||||
"
|
||||
stream.replication.port_range.min = 4000
|
||||
stream.replication.port_range.max = 4600
|
||||
",
|
||||
[{osiris, [
|
||||
{port_range, {4000, 4600}}
|
||||
]}],
|
||||
[]},
|
||||
|
||||
{stream_replication_port_range,
|
||||
"
|
||||
stream.replication.port_range.min = 4000
|
||||
",
|
||||
[{osiris, [
|
||||
{port_range, {4000, 4500}}
|
||||
]}],
|
||||
[]},
|
||||
|
||||
{stream_replication_port_range,
|
||||
"
|
||||
stream.replication.port_range.max = 4600
|
||||
",
|
||||
[{osiris, [
|
||||
{port_range, {4100, 4600}}
|
||||
]}],
|
||||
[]}
|
||||
|
||||
].
|
||||
|
|
Loading…
Reference in New Issue