Reputation: 497
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);
....
}
}
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
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