Skip to content

Commit

Permalink
support members info item in classic queues, which will always be the…
Browse files Browse the repository at this point in the history
… leader
  • Loading branch information
Ayanda-D authored and michaelklishin committed Oct 2, 2024
1 parent f9e5d34 commit 71f921c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deps/rabbit/src/rabbit_amqqueue_process.erl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
owner_pid,
exclusive,
user_who_performed_action,
leader
leader,
members
]).

-define(INFO_KEYS, [pid | ?CREATION_EVENT_KEYS ++ ?STATISTICS_KEYS -- [name, type]]).
Expand Down Expand Up @@ -1085,6 +1086,7 @@ i(arguments, #q{q = Q}) -> amqqueue:get_arguments(Q);
i(pid, _) ->
self();
i(leader, State) -> node(i(pid, State));
i(members, State) -> [i(leader, State)];
i(owner_pid, #q{q = Q}) when ?amqqueue_exclusive_owner_is(Q, none) ->
'';
i(owner_pid, #q{q = Q}) ->
Expand Down
3 changes: 2 additions & 1 deletion deps/rabbit/test/classic_queue_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ leader_locator_client_local(Config) ->
{<<"x-queue-leader-locator">>, longstr, <<"client-local">>}])),
{ok, Leader0} = rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, Q)]),
Leader = amqqueue:qnode(Leader0),
?assertEqual([{leader, Leader}], rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader]])),
?assertEqual([{leader, Leader}, {members, [Leader]}],
rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader, members]])),
?assertEqual(Server, Leader),
?assertMatch(#'queue.delete_ok'{},
amqp_channel:call(Ch, #'queue.delete'{queue = Q}))
Expand Down

0 comments on commit 71f921c

Please sign in to comment.