예제 #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);

            _httpHostPipeConfigurator.UseFilter(new HttpConsumerFilter(_hostConfiguration.Settings, receiveSettings, receiveEndpointContext));

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

            return(CreateReceiveEndpoint(string.IsNullOrWhiteSpace(_pathMatch) ? NewId.Next().ToString() : _pathMatch, transport, receiveEndpointContext));
        }
        public void Apply(IBusBuilder builder)
        {
            var receiveEndpointBuilder = new HttpReceiveEndpointBuilder(_host, CreateConsumePipe(builder), builder);

            var receivePipe = CreateReceivePipe(receiveEndpointBuilder);

            _sendEndpointProvider = CreateSendEndpointProvider(receiveEndpointBuilder);
            _publishEndpointProvider = CreatePublishEndpointProvider(receiveEndpointBuilder);

            var sendPipe = builder.CreateSendPipe();

            var receiveSettings = new Settings(_pathMatch, receiveEndpointBuilder.MessageSerializer, _sendEndpointProvider, _publishEndpointProvider);

            var transport = new HttpReceiveTransport(_host, receiveSettings, sendPipe);

            var httpHost = _host as HttpHost;
            if (httpHost == null)
                throw new ConfigurationException("Must be a HttpHost");

            httpHost.ReceiveEndpoints.Add(NewId.Next().ToString(), new ReceiveEndpoint(transport, receivePipe));
        }
        public void Apply(IBusBuilder builder)
        {
            var receiveEndpointBuilder = new HttpReceiveEndpointBuilder(builder, _host, _hosts, _configuration);

            var receiveEndpointTopology = receiveEndpointBuilder.CreateReceiveEndpointTopology(InputAddress);

            var receivePipe = CreateReceivePipe(receiveEndpointBuilder);

            _sendEndpointProvider    = receiveEndpointTopology.SendEndpointProvider;
            _publishEndpointProvider = receiveEndpointTopology.PublishEndpointProvider;

            var receiveSettings = new Settings(_pathMatch);

            var transport = new HttpReceiveTransport(_host, receiveSettings, receiveEndpointTopology);

            var httpHost = _host as HttpHost;

            if (httpHost == null)
            {
                throw new ConfigurationException("Must be a HttpHost");
            }

            httpHost.ReceiveEndpoints.Add(NewId.Next().ToString(), new ReceiveEndpoint(transport, receivePipe));
        }
예제 #5
0
        public void Apply(IBusBuilder builder)
        {
            var receiveEndpointBuilder = new HttpReceiveEndpointBuilder(_host, CreateConsumePipe(builder), builder);

            var receivePipe = CreateReceivePipe(receiveEndpointBuilder);

            _sendEndpointProvider    = CreateSendEndpointProvider(receiveEndpointBuilder);
            _publishEndpointProvider = CreatePublishEndpointProvider(receiveEndpointBuilder);

            var sendPipe = builder.CreateSendPipe();

            var receiveSettings = new Settings(_pathMatch, receiveEndpointBuilder.MessageSerializer, _sendEndpointProvider, _publishEndpointProvider);

            var transport = new HttpReceiveTransport(_host, receiveSettings, sendPipe);

            var httpHost = _host as HttpHost;

            if (httpHost == null)
            {
                throw new ConfigurationException("Must be a HttpHost");
            }

            httpHost.ReceiveEndpoints.Add(NewId.Next().ToString(), new ReceiveEndpoint(transport, receivePipe));
        }