Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should we use Azure Service Bus Queue built-in CorrelationId property or UserProperties?

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?

like image 586
Jane Avatar asked Jun 06 '18 03:06

Jane


1 Answers

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.

like image 172
Sean Feldman Avatar answered Sep 28 '22 09:09

Sean Feldman