Skip to content

Commit a5ebef9

Browse files
committed
Document that deduplication does not work with multi-threading
Fixes #43
1 parent 9cf6965 commit a5ebef9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/docs/asciidoc/api.adoc

+13
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,19 @@ batching messages in a single publish frame, which can already provide
506506
very high throughput.
507507
====
508508

509+
[[deduplication-multithreading]]
510+
[WARNING]
511+
.Deduplication is not guaranteed when publishing on several threads
512+
====
513+
We'll see below that deduplication works using a strictly increasing sequence for messages.
514+
This means messages must be published in order and the preferred way to do this is usually _within a single thread_.
515+
Even if messages are _created_ in order, with the proper sequence ID, if they are published in several threads, they can get out of order, e.g. message 5 can be _published_ before message 2.
516+
The deduplication mechanism will then filter out message 2 in this case.
517+
518+
So you have to be very careful about the way your applications publish messages when deduplication is in use.
519+
If you worry about performance, note it is possible to publish hundreds of thousands of messages in a single thread with RabbitMQ Stream.
520+
====
521+
509522
====== Setting the Name of a Producer
510523

511524
The producer name is set when creating the producer instance, which automatically

0 commit comments

Comments
 (0)