public void ReceiveEndpoint(IHttpHost host, string queueName, Action <IHttpReceiveEndpointConfigurator> configure)
        {
            if (!_configuration.TryGetHost(host, out var hostConfiguration))
            {
                throw new ArgumentException("The host was not configured on this bus", nameof(host));
            }

            var configuration = hostConfiguration.CreateReceiveEndpointConfiguration(queueName);

            ConfigureReceiveEndpoint(configuration, configure);
        }
Ejemplo n.º 2
0
        public Task <ISendTransport> GetSendTransport(Uri address)
        {
            if (!_busConfiguration.TryGetHost(address, out var hostConfiguration))
            {
                throw new EndpointNotFoundException($"The host was not found for the specified address: {address}");
            }

            var clientCache = new HttpClientCache(_receivePipe);

            var sendSettings = address.GetSendSettings();

            return(Task.FromResult <ISendTransport>(new HttpSendTransport(clientCache, sendSettings, _receiveObserver, _topology)));
        }
Ejemplo n.º 3
0
        public void CreateReceiveEndpoint(string pathMatch, Action <IHttpReceiveEndpointConfigurator> configure)
        {
            if (!_configuration.TryGetHost(_host, out var hostConfiguration))
            {
                throw new ConfigurationException("The host was not properly configured");
            }

            var configuration = hostConfiguration.CreateReceiveEndpointConfiguration(pathMatch);

            configure?.Invoke(configuration.Configurator);

            BusConfigurationResult.CompileResults(configuration.Validate());

            configuration.Build();
        }