diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs index 09faf1151e..78e26e7c32 100644 --- a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs @@ -108,9 +108,12 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen foreach (var outgoingEvent in outgoingEventArray) { - var message = new ServiceBusMessage(outgoingEvent.EventData) { - MessageId = outgoingEvent.Id.ToString(), Subject = outgoingEvent.EventName - }; + var message = new ServiceBusMessage(outgoingEvent.EventData) { Subject = outgoingEvent.EventName }; + + if (message.MessageId.IsNullOrWhiteSpace()) + { + message.MessageId = outgoingEvent.Id.ToString(); + } if (!messageBatch.TryAddMessage(message)) {