public void Build(IAmazonSqsHostControl host)
        {
            var builder = new AmazonSqsReceiveEndpointBuilder(host, _hostConfiguration.Settings, this);

            ApplySpecifications(builder);

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            _clientConfigurator.UseFilter(new ConfigureTopologyFilter <ReceiveSettings>(_settings, receiveEndpointContext.BrokerTopology));

            IAgent consumerAgent;

            if (_hostConfiguration.DeployTopologyOnly)
            {
                var transportReadyFilter = new TransportReadyFilter <ClientContext>(receiveEndpointContext);
                _clientConfigurator.UseFilter(transportReadyFilter);

                consumerAgent = transportReadyFilter;
            }
            else
            {
                if (_settings.PurgeOnStartup)
                {
                    _clientConfigurator.UseFilter(new PurgeOnStartupFilter(_settings.EntityName));
                }

                var consumerFilter = new AmazonSqsConsumerFilter(receiveEndpointContext);

                _clientConfigurator.UseFilter(consumerFilter);

                consumerAgent = consumerFilter;
            }

            IFilter <ConnectionContext> clientFilter = new ReceiveClientFilter(_clientConfigurator.Build());

            _connectionConfigurator.UseFilter(clientFilter);

            var transport = new SqsReceiveTransport(host, _settings, _connectionConfigurator.Build(), receiveEndpointContext);

            transport.Add(consumerAgent);

            var receiveEndpoint = new ReceiveEndpoint(transport, receiveEndpointContext);

            var queueName = _settings.EntityName ?? NewId.Next().ToString(FormatUtil.Formatter);

            host.AddReceiveEndpoint(queueName, receiveEndpoint);

            ReceiveEndpoint = receiveEndpoint;
        }
        public override IReceiveEndpoint Build()
        {
            var builder = new AmazonSqsReceiveEndpointBuilder(this);

            ApplySpecifications(builder);

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            _clientConfigurator.UseFilter(new ConfigureTopologyFilter <ReceiveSettings>(_settings, receiveEndpointContext.BrokerTopology));

            IAgent consumerAgent;

            if (_hostConfiguration.BusConfiguration.DeployTopologyOnly)
            {
                var transportReadyFilter = new TransportReadyFilter <ClientContext>(receiveEndpointContext);
                _clientConfigurator.UseFilter(transportReadyFilter);

                consumerAgent = transportReadyFilter;
            }
            else
            {
                if (_settings.PurgeOnStartup)
                {
                    _clientConfigurator.UseFilter(new PurgeOnStartupFilter(_settings.EntityName));
                }

                var consumerFilter = new AmazonSqsConsumerFilter(receiveEndpointContext);

                _clientConfigurator.UseFilter(consumerFilter);

                consumerAgent = consumerFilter;
            }

            IFilter <ConnectionContext> clientFilter = new ReceiveClientFilter(_clientConfigurator.Build());

            _connectionConfigurator.UseFilter(clientFilter);

            var transport = new SqsReceiveTransport(_hostConfiguration.Host, _settings, _connectionConfigurator.Build(), receiveEndpointContext);

            transport.Add(consumerAgent);

            return(CreateReceiveEndpoint(_settings.EntityName ?? NewId.Next().ToString(), transport, receiveEndpointContext));
        }