Skip to content

Commit 29b7c3e

Browse files
acogoluegnesmergify[bot]
authored andcommitted
Add stream replication port range in ini-style configuration
This is more straightforward than configuring Osiris in the advanced configuration file. (cherry picked from commit eeb35d2) (cherry picked from commit f7d6424) # Conflicts: # deps/rabbit/priv/schema/rabbit.schema
1 parent 89fc889 commit 29b7c3e

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

deps/rabbit/priv/schema/rabbit.schema

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,61 @@ end}.
26362636
}.
26372637

26382638
% ===============================
2639+
<<<<<<< HEAD
2640+
=======
2641+
% AMQP 1.0
2642+
% ===============================
2643+
2644+
%% Connections that skip SASL layer or use SASL mechanism ANONYMOUS will connect as this account.
2645+
%% Setting this to a username will allow clients to connect without authenticating.
2646+
%% For production environments, set this value to 'none'.
2647+
{mapping, "amqp1_0.default_user", "rabbit.amqp1_0_default_user",
2648+
[{datatype, [{enum, [none]}, string]}]}.
2649+
2650+
{mapping, "amqp1_0.default_vhost", "rabbit.amqp1_0_default_vhost",
2651+
[{datatype, string}]}.
2652+
2653+
{translation, "rabbit.amqp1_0_default_user",
2654+
fun(Conf) ->
2655+
case cuttlefish:conf_get("amqp1_0.default_user", Conf) of
2656+
none -> none;
2657+
User -> list_to_binary(User)
2658+
end
2659+
end}.
2660+
2661+
{translation , "rabbit.amqp1_0_default_vhost",
2662+
fun(Conf) ->
2663+
list_to_binary(cuttlefish:conf_get("amqp1_0.default_vhost", Conf))
2664+
end}.
2665+
2666+
{mapping, "stream.replication.port_range.min", "osiris.port_range", [
2667+
{datatype, [integer]},
2668+
{validators, ["non_zero_positive_integer"]}
2669+
]}.
2670+
{mapping, "stream.replication.port_range.max", "osiris.port_range", [
2671+
{datatype, [integer]},
2672+
{validators, ["non_zero_positive_integer"]}
2673+
]}.
2674+
2675+
{translation, "osiris.port_range",
2676+
fun(Conf) ->
2677+
Min = cuttlefish:conf_get("stream.replication.port_range.min", Conf, undefined),
2678+
Max = cuttlefish:conf_get("stream.replication.port_range.max", Conf, undefined),
2679+
2680+
case {Min, Max} of
2681+
{undefined, undefined} ->
2682+
cuttlefish:unset();
2683+
{Mn, undefined} ->
2684+
{Mn, Mn + 500};
2685+
{undefined, Mx} ->
2686+
{Mx - 500, Mx};
2687+
_ ->
2688+
{Min, Max}
2689+
end
2690+
end}.
2691+
2692+
% ===============================
2693+
>>>>>>> f7d6424d42 (Add stream replication port range in ini-style configuration)
26392694
% Validators
26402695
% ===============================
26412696

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)