Skip to content

Commit 28f16ae

Browse files
committed
issue #52: remove rejected messages from queue deduplication cache
Signed-off-by: Matteo Cafasso <[email protected]>
1 parent 00c14f7 commit 28f16ae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/rabbit_message_deduplication_queue.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,11 @@ defmodule RabbitMQ.MessageDeduplicationPlugin.Queue do
296296
end
297297

298298
def ackfold(function, acc, state, acks = [dqack() | _]) do
299-
dqstate(queue_state: qs) = state
300-
acks = Enum.map(acks, fn(dqack(tag: ack_tag)) -> ack_tag end)
299+
dqstate(queue: queue, queue_state: qs) = state
300+
acks = Enum.map(acks, fn(dqack(tag: ack_tag, header: header)) ->
301+
maybe_delete_cache_entry(queue, header)
302+
ack_tag
303+
end)
301304

302305
passthrough2(state, do: ackfold(function, acc, qs, acks))
303306
end

0 commit comments

Comments
 (0)