We're developing a Web API application that will receive a correlation-id header (GUID) in the request and will trigger a backend process asynchronously by sending a message to an Azure Service Bus Queue. We'd like to pass this correlation-id around for end to end monitoring purposes.
Should we use the CorrelationId built-in property or add a CorrelationId user property to UserProperties dictionary of the Microsoft.Azure.ServiceBus.Message? What's the best practice?
The CorrelationId
property is there for convenience just like the ContentType
, To
or ReplyTo
properties. They are typically used for various message patterns and unlike other system properties can be used without any concerns.
Short answer: use it rather than duplicating by introducing a custom property with identical intent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With