Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorrelationId and other properties are not available via the AzureServiceBusMessageContext #421

Open
fgheysels opened this issue Nov 8, 2023 · 5 comments

Comments

@fgheysels
Copy link
Member

Is your feature request related to a problem? Please describe.
We have a system that posts messages to Azure ServiceBus, and that system uses the CorrelationId property of the ServiceBusMessage to add a correlation-id to the message.

We have another process that consumes ServiceBus via Arcus.Messaging, but there seems to be no way to retrieve the CorrelationId property from the message.
I believe this property should be available through the AzureServiceBusMessageContext class ?

Note that there also other properties available on ServiceBusMessage that might be of interest:

  • ContentType
  • MessageId
  • ReplyTo
  • SessionId
  • ...
@stijnmoreels
Copy link
Member

I believe that the message's correlation ID will correspond with the operation ID that is available in the MessageCorrelationInfo. It would be breaking of abstraction if it would be available in the message context.

For the other properties, you can use the system properties within the message context to get the available ones: https://github.com/arcus-azure/arcus.messaging/blob/main/src/Arcus.Messaging.Abstractions.ServiceBus/AzureServiceBusSystemProperties.cs

@fgheysels
Copy link
Member Author

Note that the Arcus ServiceBusMessage builders are not used. The CorrelationId that has been set is not available in the MessageCorrelationInfo information of the context. The MessageCorrelationInfo structure contains some other (generated) information though. Might be an idea to first look at the CorrelationId property of the message before generating a new value of the operationId ?

I understand that we should not break abstraction, but on the other hand, the class is called AzureServiceBusContext , but I understand that we should have this available through the base class as well.

@stijnmoreels
Copy link
Member

The correlation information in a W3C context is not generated, but retrieved from the current activity and (I thought) the correlation ID of the message?

@beaujanssens
Copy link

Hi Stijn!
Chiming in here with some screenshots of the specific case in which we are encountering this issue. First one shows the correlation id I set in the Broker Properties of the message I post on service bus and the second one shows the operation id I see in the MessageCorrelationInfo object I subsequently receive in my code. As you can see these do not seem to match.
Schermafbeelding 2023-11-08 131938
Schermafbeelding 2023-11-08 132423

@stijnmoreels
Copy link
Member

I'm just thinking that the CorrelationId might be something that was used for Hierarchical tracking, but not for W3C correlation 🤔 It might be something 'extra' for service bus, but not required for W3C service-to-service correlation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants