Reputation: 161
in my .Net project I need to set the MessageId of the message I send to an Azure ServiceBus Queue, so I have code like this:
sendOptions.SetMessageId(message.MessageId);
MessageSession.Send(command, sendOptions, cancellationToken);
Where MessageSessions
is an instance of NServiceBus.IMessageSession
But, when I peek at the messages, I see unrelated GUID are used for message ID and the value I set is used for correlationId instead.
Upvotes: 0
Views: 108
Reputation: 25994
There are two message IDs, logical and physical. SetMessageId
is for logical message ID. Physical message ID is set by NServiceBus and cannot be mutated. You could try working around it by customizing the native outgoing message but if you re-use MessageId and have delayed retries, it won’t be compatible with ASB transport and queue configuration, that could have native de-dup enabled.
Upvotes: 2