Skip to content

Commit 4f23561

Browse files
dcorbachomergify[bot]
authored andcommitted
Local shovel: ensure no more messages are published with delete-after
once the limit is reached (cherry picked from commit 62daba4)
1 parent c5ba0fa commit 4f23561

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

deps/rabbitmq_shovel/src/rabbit_local_shovel.erl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@ ack(DeliveryTag, Multiple, State) ->
369369
nack(DeliveryTag, Multiple, State) ->
370370
maybe_grant_credit(settle(requeue, DeliveryTag, Multiple, State)).
371371

372+
forward(_, _, #{source := #{remaining_unacked := 0}} = State) ->
373+
%% We are in on-confirm mode, and are autodelete. We have
374+
%% published all the messages we need to; we just wait for acks to
375+
%% come back. So drop subsequent messages on the floor to be
376+
%% requeued later
377+
State;
372378
forward(Tag, Msg0, #{dest := #{current := #{queue_states := QState} = Current} = Dest,
373379
ack_mode := AckMode} = State0) ->
374380
{Options, #{dest := #{current := Current1} = Dest1} = State} =

0 commit comments

Comments
 (0)