Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }