Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit dded559

Browse files
committed
rabbit_backing_queue: extend is_duplicate callback return values
Allow the backing queue implementation to inform the amqqueue process how to proceed when a message duplicate is encountered. * {true, drop} the message is a duplicate and should be ignored * {true, reject} the message is a duplicate and the publisher should receive a rejection * false the message is not deemed a duplicate * true kept for backward compatibility, equivalent to {true, drop} Signed-off-by: Matteo Cafasso <[email protected]>
1 parent 2b269a4 commit dded559

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rabbit_backing_queue.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@
255255

256256
%% Called prior to a publish or publish_delivered call. Allows the BQ
257257
%% to signal that it's already seen this message, (e.g. it was published
258-
%% or discarded previously) and thus the message should be dropped.
258+
%% or discarded previously) specifying whether to drop the message or reject it.
259259
-callback is_duplicate(rabbit_types:basic_message(), state())
260-
-> {boolean(), state()}.
260+
-> {{true, drop} | {true, reject} | boolean(), state()}.
261261

262262
-callback set_queue_mode(queue_mode(), state()) -> state().
263263

0 commit comments

Comments
 (0)