rebus-org / Rebus

:bus: Simple and lean service bus implementation for .NET
https://mookid.dk/category/rebus
Other
2.26k stars 353 forks source link

Empty session ID header added on retry #1139

Closed NickHedgesAE closed 2 months ago

NickHedgesAE commented 4 months ago

Hi,

Something weird has started happening recently that I do not have a solution for. I am using Rebus for Azure Service Bus messaging and the retry approach I am using is simply if a message fails to be handled, place it on an error queue. Sometimes errors do happen of course, and when messages appear in the error queue they suddenly have an extra header that wasn't present in the original message. Below screenshot was taken in Azure Service Bus Explorer. The Message custom properties section is normally reserved for headers specific to Rebus, but suddenly it also includes the built-in SessionId after retries. Since my implementation never uses SessionId this value is empty, which is not allowed for custom properties. The issue lies in the fact that replaying these messages is impossible without removing this header manually from the custom properties. This is a hassle, as I have to do this one-by-one.

Screenshot 2024-02-06 100206

Is there a setting that I missed somewhere?

mookid8000 commented 2 months ago

Turned out that some of Rebus' header gymnastics would accidentally pull in a "SessionId" header, even though the ASB message had an empty session ID.

It's fixed in Rebus.AzureServiceBus 10.1.1, which is on NuGet.org now 🙂