public void Build(IHost host)
        {
            var builder = new ServiceBusSubscriptionEndpointBuilder(_hostConfiguration, this);

            ApplySpecifications(builder);

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            ClientPipeConfigurator.UseFilter(new ConfigureTopologyFilter <SubscriptionSettings>(_settings, receiveEndpointContext.BrokerTopology,
                                                                                                _settings.RemoveSubscriptions, _hostConfiguration.ConnectionContextSupervisor.Stopping));

            CreateReceiveEndpoint(host, receiveEndpointContext);
        }
        public override void Apply(IBusBuilder builder)
        {
            var receiveEndpointBuilder = new ServiceBusSubscriptionEndpointBuilder(builder, Host, _configuration, _sendTransportProvider);

            var receivePipe = CreateReceivePipe(receiveEndpointBuilder);

            var receiveEndpointTopology = receiveEndpointBuilder.CreateReceiveEndpointTopology(InputAddress, _settings);

            ApplyReceiveEndpoint(receivePipe, receiveEndpointTopology, x =>
            {
                x.UseFilter(new ConfigureTopologyFilter <SubscriptionSettings>(_settings, receiveEndpointTopology.BrokerTopology, false));
                x.UseFilter(new PrepareSubscriptionClientFilter(_settings));
            });
        }
        public override IReceiveEndpoint Build()
        {
            var builder = new ServiceBusSubscriptionEndpointBuilder(this);

            ApplySpecifications(builder);

            var receivePipe = CreateReceivePipe();

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            NamespacePipeConfigurator.UseFilter(new ConfigureTopologyFilter <SubscriptionSettings>(_settings, receiveEndpointContext.BrokerTopology,
                                                                                                   _settings.RemoveSubscriptions));

            return(CreateReceiveEndpoint(builder, receivePipe, receiveEndpointContext));
        }
        public IBrokeredMessageReceiver Build()
        {
            var result = BusConfigurationResult.CompileResults(Validate());

            try
            {
                var builder = new ServiceBusSubscriptionEndpointBuilder(_hostConfiguration, _endpointConfiguration);

                foreach (var specification in Specifications)
                {
                    specification.Configure(builder);
                }

                return(new BrokeredMessageReceiver(builder.CreateReceiveEndpointContext()));
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(result, "An exception occurred creating the BrokeredMessageReceiver", ex);
            }
        }