Format stream management source files

This commit is contained in:
Arnaud Cogoluègnes 2022-02-02 11:30:06 +01:00
parent 2af24048b9
commit f8657e02ef
No known key found for this signature in database
GPG Key ID: D5C8C4DFAD43AFA8
8 changed files with 60 additions and 44 deletions

View File

@ -23,11 +23,12 @@
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/connections/:vhost/:connection/consumers", ?MODULE, []}];
false -> []
true ->
[{"/stream/connections/:vhost/:connection/consumers", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
[].

View File

@ -24,11 +24,12 @@
-include_lib("rabbit_common/include/rabbit.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/connections/:vhost/:connection", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/connections/:vhost/:connection", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
[].

View File

@ -22,11 +22,13 @@
-include_lib("rabbit_common/include/rabbit.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/connections/:vhost/:connection/publishers", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/connections/:vhost/:connection/publishers", ?MODULE,
[]}];
false ->
[]
end.
web_ui() ->
[].

View File

@ -19,22 +19,28 @@
-include_lib("rabbitmq_management_agent/include/rabbit_mgmt_records.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/connections", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/connections", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{javascript, <<"stream.js">>}];
false -> rabbit_log:warning(
"Unable to show the stream management plugin. The stream_queue feature flag is disabled. "++
"Enable stream_queue feature flag then disable and re-enable the rabbitmq_stream_management plugin. ",
"See https://www.rabbitmq.com/feature-flags.html to learn more",
[]),
[]
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{javascript, <<"stream.js">>}];
false ->
rabbit_log:warning("Unable to show the stream management plugin. "
"The stream_queue feature flag is disabled. "
++ "Enable stream_queue feature flag then disable "
"and re-enable the rabbitmq_stream_management "
"plugin. ",
"See https://www.rabbitmq.com/feature-flags.html "
"to learn more",
[]),
[]
end.
%%--------------------------------------------------------------------

View File

@ -21,10 +21,12 @@
-include_lib("amqp_client/include/amqp_client.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/connections/:vhost", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/connections/:vhost", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
[].

View File

@ -21,11 +21,13 @@
-include_lib("rabbit_common/include/rabbit.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/consumers", ?MODULE, []},
{"/stream/consumers/:vhost", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/consumers", ?MODULE, []},
{"/stream/consumers/:vhost", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
[].

View File

@ -34,5 +34,5 @@ keep_tracked_stream_connections(Connections) ->
Connections).
is_feature_flag_enabled() ->
FeatureFlagsEnabled = rabbit_ff_registry:list(enabled),
maps:is_key(stream_queue, FeatureFlagsEnabled).
FeatureFlagsEnabled = rabbit_ff_registry:list(enabled),
maps:is_key(stream_queue, FeatureFlagsEnabled).

View File

@ -21,12 +21,14 @@
-include_lib("rabbit_common/include/rabbit.hrl").
dispatcher() ->
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true -> [{"/stream/publishers", ?MODULE, []},
{"/stream/publishers/:vhost", ?MODULE, []},
{"/stream/publishers/:vhost/:queue", ?MODULE, []}];
false -> []
end.
case rabbit_stream_management_utils:is_feature_flag_enabled() of
true ->
[{"/stream/publishers", ?MODULE, []},
{"/stream/publishers/:vhost", ?MODULE, []},
{"/stream/publishers/:vhost/:queue", ?MODULE, []}];
false ->
[]
end.
web_ui() ->
[].