Skip to content

Possible double delivery/processing of a single message with multiple consumers (C# RabbitMQ.Client 7.1.2, prefetch=1, no redelivery, only one publish) #1847

Closed Answered by sintesfabien
sintesfabien asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your help.
After further investigation, I found that the issue was caused by passing the BasicDeliverEventArgs object (ea) directly to an asynchronous task.
Since this object can be reused or modified by the RabbitMQ client, its content may change between the event handler and the asynchronous processing, leading to message mismatches and unexpected behavior.
This behavior is indeed documented in the RabbitMQ and AMQP client documentation.
Copying the message body and relevant properties immediately in the event handler before starting any asynchronous processing solves the problem.
Thank you again for your guidance and support.

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@sintesfabien
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lukebakken
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lukebakken
Comment options

Answer selected by lukebakken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants