Ejemplo n.º 1
0
        public HttpBusBuilder(BusHostCollection <HttpHost> hosts, IHttpEndpointConfiguration configuration)
            : base(hosts, configuration)
        {
            _hosts = hosts;

            var endpointSpecification = configuration.CreateNewConfiguration(ConsumePipe);

            _busEndpointSpecification = new HttpReceiveEndpointSpecification(_hosts[0], _hosts, "", endpointSpecification);

            foreach (var host in hosts.Hosts)
            {
                var factory = new HttpReceiveEndpointFactory(this, host, hosts, configuration);

                host.ReceiveEndpointFactory = factory;
            }
        }
        public void ReceiveEndpoint(IHttpHost host, string pathMatch, Action <IHttpReceiveEndpointConfigurator> configure = null)
        {
            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            var endpointSpecification = _configuration.CreateNewConfiguration();

            var specification = new HttpReceiveEndpointSpecification(host, _hosts, pathMatch, endpointSpecification);

            specification.ConnectConsumerConfigurationObserver(this);
            specification.ConnectSagaConfigurationObserver(this);

            configure?.Invoke(specification);

            AddBusFactorySpecification(specification);
        }