public async Task <ISendEndpoint> GetSendEndpoint(Uri address)
        {
            IServiceBusHost host;

            if (!TryGetMatchingHost(address, out host))
            {
                throw new EndpointNotFoundException("The endpoint address specified an unknown host: " + address);
            }

            TopicDescription topicDescription =
                await(await host.RootNamespaceManager.ConfigureAwait(false)).CreateTopicSafeAsync(address.GetTopicDescription()).ConfigureAwait(false);

            MessagingFactory messagingFactory = await host.MessagingFactory.ConfigureAwait(false);

            MessageSender messageSender = await messagingFactory.CreateMessageSenderAsync(topicDescription.Path).ConfigureAwait(false);

            var sendTransport = new ServiceBusSendTransport(messageSender);

            sendTransport.ConnectSendObserver(_sendObservable);

            return(new SendEndpoint(sendTransport, _serializer, address, _sourceAddress));
        }
        public async Task <ISendEndpoint> GetSendEndpoint(Uri address)
        {
            IServiceBusHost host =
                _hosts.FirstOrDefault(x => x.Settings.ServiceUri.Host.Equals(address.Host, StringComparison.OrdinalIgnoreCase));

            if (host == null)
            {
                throw new EndpointNotFoundException("The endpoint address specified an unknown host: " + address);
            }

            TopicDescription topicDescription =
                await(await host.RootNamespaceManager.ConfigureAwait(false)).CreateTopicSafeAsync(address.GetTopicDescription()).ConfigureAwait(false);

            MessagingFactory messagingFactory = await host.MessagingFactory.ConfigureAwait(false);

            MessageSender messageSender = await messagingFactory.CreateMessageSenderAsync(topicDescription.Path).ConfigureAwait(false);

            var sendTransport = new ServiceBusSendTransport(messageSender);

            sendTransport.ConnectSendObserver(_sendObservable);

            return(new SendEndpoint(sendTransport, _serializer, address, _sourceAddress));
        }