If the Received event occurs before "reading e.Body.ToArray()", then the message is incorrect #1655
Closed
quanzhenying
started this conversation in
General
Replies: 1 comment
-
@quanzhenying the concurrent dispatch behavior is not a bug. This is a perfectly fine behavior given that you consume from N queues concurrently on N channels. Delivery across channels are not coordinated in any way, and this never was the goal. The fact that you did not observe it on 5.x is a coincidence, a difference in consumer operation dispatch implementations. As for message body operations, see Consumer Memory Safety which is a new behavior by design in 6.x and onwards. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Messages from different queues are interweaving across threads.
Affected versions: All versions of 6.x
`
Received Event
`
Reproduction steps
1.Two queues are consuming messages simultaneously, using the same "Received" event for processing.
2.Within the Received event, add an await before reading the Body.
3.If the line await Task.Delay(rd.Next(0, 2)); is removed, the issue will not reproduce.
All code:
`
using RabbitMQ.Client.Events;
using RabbitMQ.Client;
using System.Text;
`
Expected behavior
"Task.Delay(rd.Next(0, 2))" should not cause the Body to contain the content of another message.
Additional context
1.Version 5.1.2 does not have this issue;
2.Using “Task.Delay(rd.Next(0, 2)).GetAwaiter().GetResult()” also does not have this issue.
Beta Was this translation helpful? Give feedback.
All reactions