Skip to content

Commit c270ebf

Browse files
committed
Disable the stream_plugin if the feature flag
is not enabled. fixes #3557
1 parent 4ce920c commit c270ebf

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

deps/rabbitmq_stream/src/rabbit_stream.erl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,23 @@
3939
-include("rabbit_stream_metrics.hrl").
4040

4141
start(_Type, _Args) ->
42-
rabbit_stream_metrics:init(),
43-
rabbit_global_counters:init([{protocol, stream}], ?PROTOCOL_COUNTERS),
44-
rabbit_global_counters:init([{protocol, stream},
45-
{queue_type, ?STREAM_QUEUE_TYPE}]),
46-
rabbit_stream_sup:start_link().
42+
FeatureFlagsEnabled = rabbit_ff_registry:list(enabled),
43+
case maps:is_key(stream_queue, FeatureFlagsEnabled) of
44+
true -> rabbit_stream_metrics:init(),
45+
rabbit_global_counters:init([{protocol, stream}], ?PROTOCOL_COUNTERS),
46+
rabbit_global_counters:init([{protocol, stream},
47+
{queue_type, ?STREAM_QUEUE_TYPE}]),
48+
rabbit_stream_sup:start_link();
49+
false ->
50+
rabbit_log:warning(
51+
"Unable to start the stream plugin. The feature flag stream_queue is disabled \n"++
52+
"You need to enable it and restart the broker",
53+
[]),
54+
55+
{ok, self()}
56+
end.
57+
58+
4759

4860
tls_host() ->
4961
case application:get_env(rabbitmq_stream, advertised_tls_host,

0 commit comments

Comments
 (0)