Skip to content

Commit 7fad984

Browse files
Merge pull request #9035 from rabbitmq/ik-collect-acks-comment
Update collect_acks comment and clarify the special 0 case.
2 parents d7c700a + 4ca7094 commit 7fad984

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

deps/rabbit/src/rabbit_channel.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,9 +2012,10 @@ record_sent(Type, QueueType, Tag, AckRequired,
20122012
%% Records a client-sent acknowledgement. Handles both single delivery acks
20132013
%% and multi-acks.
20142014
%%
2015-
%% Returns a triple of acknowledged pending acks, remaining pending acks,
2016-
%% and outdated pending acks (if any).
2017-
%% Sorts each group in the youngest-first order (ascending by delivery tag).
2015+
%% Returns a tuple of acknowledged pending acks and remaining pending acks.
2016+
%% Sorts each group in the youngest-first order (descending by delivery tag).
2017+
%% The special case for 0 comes from the AMQP 0-9-1 spec: if the multiple field is set to 1 (true),
2018+
%% and the delivery tag is 0, this indicates acknowledgement of all outstanding messages (by a client).
20182019
collect_acks(UAMQ, 0, true) ->
20192020
{lists:reverse(?QUEUE:to_list(UAMQ)), ?QUEUE:new()};
20202021
collect_acks(UAMQ, DeliveryTag, Multiple) ->

0 commit comments

Comments
 (0)