|
|
|
@ -87,7 +87,7 @@ namespace Volo.Abp.EventBus.Azure |
|
|
|
|
|
|
|
public override async Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) |
|
|
|
{ |
|
|
|
await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData); |
|
|
|
await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, outgoingEvent.Id); |
|
|
|
} |
|
|
|
|
|
|
|
public override async Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig) |
|
|
|
@ -188,15 +188,28 @@ namespace Volo.Abp.EventBus.Azure |
|
|
|
unitOfWork.AddOrReplaceDistributedEvent(eventRecord); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task PublishAsync(string eventName, object eventData) |
|
|
|
protected virtual Task PublishAsync(string eventName, object eventData) |
|
|
|
{ |
|
|
|
var body = _serializer.Serialize(eventData); |
|
|
|
|
|
|
|
return PublishAsync(eventName, body, null); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task PublishAsync( |
|
|
|
string eventName, |
|
|
|
byte[] body, |
|
|
|
Guid? eventId) |
|
|
|
{ |
|
|
|
var message = new ServiceBusMessage(body) |
|
|
|
{ |
|
|
|
Subject = eventName |
|
|
|
}; |
|
|
|
|
|
|
|
if (message.MessageId.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
message.MessageId = (eventId ?? GuidGenerator.Create()).ToString("N"); |
|
|
|
} |
|
|
|
|
|
|
|
var publisher = await _publisherPool.GetAsync( |
|
|
|
_options.TopicName, |
|
|
|
_options.ConnectionName); |
|
|
|
|