예제 #1
0
        public void Build(IHttpHostControl host)
        {
            var builder = new HttpReceiveEndpointBuilder(host, this);

            ApplySpecifications(builder);

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            var receiveSettings = new Settings(_pathMatch);

            var httpConsumerFilter = new HttpConsumerFilter(_hostConfiguration.Settings, receiveSettings, receiveEndpointContext);

            _httpHostPipeConfigurator.UseFilter(httpConsumerFilter);

            var transport = new HttpReceiveTransport(host, receiveEndpointContext, _httpHostPipeConfigurator.Build());

            transport.Add(httpConsumerFilter);

            var receiveEndpoint = new ReceiveEndpoint(transport, receiveEndpointContext);

            var queueName = string.IsNullOrWhiteSpace(_pathMatch) ? NewId.Next().ToString(FormatUtil.Formatter) : _pathMatch;

            host.AddReceiveEndpoint(queueName, receiveEndpoint);

            ReceiveEndpoint = receiveEndpoint;
        }
예제 #2
0
        public override IReceiveEndpoint Build()
        {
            var builder = new HttpReceiveEndpointBuilder(this);

            ApplySpecifications(builder);

            var receiveEndpointContext = builder.CreateReceiveEndpointContext();

            var receiveSettings = new Settings(_pathMatch);

            var httpConsumerFilter = new HttpConsumerFilter(_hostConfiguration.Settings, receiveSettings, receiveEndpointContext);

            _httpHostPipeConfigurator.UseFilter(httpConsumerFilter);

            var transport = new HttpReceiveTransport(_hostConfiguration.Host, receiveEndpointContext, _httpHostPipeConfigurator.Build());

            transport.Add(httpConsumerFilter);

            return(CreateReceiveEndpoint(string.IsNullOrWhiteSpace(_pathMatch) ? NewId.Next().ToString() : _pathMatch, transport, receiveEndpointContext));
        }