Delivery body corruption after upgrading from 5.1.0 to 6.8.1 #1863
Replies: 3 comments 1 reply
-
@joaoantunesvisma In
|
Beta Was this translation helpful? Give feedback.
-
Oh, there you go. Consumer Memory Safety Requirements is what you are after. I cannot tell from the code snippet whether the handler already returns by the time the deserialization code runs but it's almost certainly a documented behavior and the price everyone has to pay for the benefits of using |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick feedback! 🙏 I’ve also updated directly to 7.1.2, and so far I’m not seeing these errors anymore. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
After upgrading from RabbitMQ.Client 5.2.0 to 6.8.1, BasicDeliverEventArgs.Body.ToArray() returns corrupted data containing binary garbage and/or truncated content under high load conditions in production. The corruption only occurs under high message throughput and never in local/staging environments.
Reproduction steps
Expected behavior
BasicDeliverEventArgs.Body.ToArray() should return clean, valid message bytes that can be properly deserialized as JSON, just like it worked perfectly in RabbitMQ.Client 5.2.0 under the same conditions.
Additional context
Environment:
• RabbitMQ.Client: 6.8.1 (upgraded from 5.2.0)
• Framework: .NET 8
• Deployment: Production Kubernetes with high message throughput
• Scope: Only fails in production under load, works perfectly in local/staging
Breaking change context:
// 5.x - worked perfectly
public byte[] Body { get; set; }
// 6.x - introduces corruption
public ReadOnlyMemory Body { get; set; }
Corruption examples observed:
1. Binary prefix contamination
Content: ��n��s���|�q�v��5W�쿨��i�}�Z�"��x����...
Error: Unexpected character encountered while parsing value: . Path '', line 0, position 0
2. Message truncation at specific positions
Content: {"id":"test","data":"..."} [TRUNCATED AT POSITION 285]
Error: Unterminated string. Expected delimiter: ". Path 'url', line 1, position 285
3. Mixed binary/valid JSON content
Content: �˯^�k��@ct��C���p:�ܔ�...:"application/x-www-form-urlencoded","webHookType":7}
Error: Unexpected character encountered while parsing value: . Path '', line 0
Migration context:
This issue is blocking our planned migration path from 5.x → 6.x → 7.x. We chose incremental upgrades to minimize risk, but the corruption in 6.x is preventing progress. We're currently stuck on the upgrade.
Any guidance on root cause, workarounds, or recommended migration path would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions