public void CreateSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure)
        {
            var endpointConfiguration = _configuration.CreateNewConfiguration();

            var endpointConfigurator = new ServiceBusSubscriptionEndpointSpecification(_host, settings, endpointConfiguration, _sendTransportProvider);

            configure?.Invoke(endpointConfigurator);

            BusConfigurationResult.CompileResults(endpointConfigurator.Validate());

            endpointConfigurator.Apply(_builder);
        }
        public void CreateReceiveEndpoint(string queueName, Action <IServiceBusReceiveEndpointConfigurator> configure)
        {
            var endpointTopologySpecification = _configuration.CreateNewConfiguration();

            var endpointConfigurator = new ServiceBusReceiveEndpointSpecification(_host, queueName, endpointTopologySpecification, _sendTransportProvider);

            configure?.Invoke(endpointConfigurator);

            BusConfigurationResult.CompileResults(endpointConfigurator.Validate());

            endpointConfigurator.Apply(_builder);
        }
        public ServiceBusBusBuilder(BusHostCollection <ServiceBusHost> hosts, ReceiveEndpointSettings settings,
                                    IServiceBusEndpointConfiguration configuration, ISendTransportProvider sendTransportProvider)
            : base(hosts, configuration)
        {
            if (hosts == null)
            {
                throw new ArgumentNullException(nameof(hosts));
            }

            var endpointTopologySpecification = configuration.CreateNewConfiguration(ConsumePipe);

            _busEndpointSpecification = new ServiceBusReceiveEndpointSpecification(hosts[0], settings, endpointTopologySpecification, sendTransportProvider);

            foreach (var host in hosts.Hosts)
            {
                host.ReceiveEndpointFactory      = new ServiceBusReceiveEndpointFactory(this, host, configuration, sendTransportProvider);
                host.SubscriptionEndpointFactory = new ServiceBusSubscriptionEndpointFactory(this, host, configuration, sendTransportProvider);
            }
        }