public async Task PublishAsync(TransportMessage message, PublishOptions options) { ServiceBusMessageSender sender; if (!this.publisherCache.TryGetValue(options.Topic, out sender)) { sender = await this.factory.CreateMessageSenderAsync(options.Destination()) .ConfigureAwait(false); this.publisherCache.TryAdd(options.Topic, sender); } await sender.SendAsync(message.ToBrokeredMessage()) .ConfigureAwait(false); }
public async Task PublishAsync(TransportMessage message, PublishOptions options) { ServiceBusMessageSender sender; if (!this.publisherCache.TryGetValue(options.Topic, out sender)) { sender = await this.factory.CreateMessageSenderAsync(options.Destination()) .ConfigureAwait(false); this.publisherCache.TryAdd(options.Topic, sender); } await sender.SendAsync(message.ToBrokeredMessage()) .ConfigureAwait(false); }