tubakaya
tubakaya

Reputation: 497

Correlation Id missing dashes with MassTransit and Azure Service Bus

Dashes are removed from the correlation id Guid value in messages while using MassTransit and Azure Service Bus.

Here is how we set the correlation id, which is according to the documentation:

services.AddMassTransit(x =>
{
      MessageCorrelation.UseCorrelationId<MyMessage>(x => Guid.NewGuid());
     x.AddConsumer<...Consumer>();
     x.UsingAzureServiceBus((IBusRegistrationContext context, IServiceBusBusFactoryConfigurator cfg) =>
     {
          cfg.Host(config.AzureServiceBus.ConnectionString);               
          ....
     }
}

enter image description here

We are on MassTransit nuget v8.0.6 but trying with 8.0.12 didn't help.

I have not found any reported issues related to this on masstransit github repo.

It seems like a bug as I cannot think of any reason why dashes should be removed.

Upvotes: 0

Views: 332

Answers (1)

Michiel van Oosterhout
Michiel van Oosterhout

Reputation: 23094

I found it here by searching the MassTransit code:

if (context.CorrelationId.HasValue)
    message.CorrelationId = context.CorrelationId.Value.ToString("N");

So indeed, it seems like the developers chose that particular format on purpose.

Upvotes: 2

Related Questions