public InMemoryReceiveEndpointBuilder(IBusBuilder busBuilder, InMemoryHost host, ISendTransportProvider sendTransportProvider, IInMemoryEndpointConfiguration configuration)
     : base(busBuilder, configuration)
 {
     _host = host;
     _sendTransportProvider = sendTransportProvider;
     _configuration         = configuration;
 }
        public InMemoryBusBuilder(InMemoryHost inMemoryHost, ISendTransportProvider sendTransportProvider, BusHostCollection <IBusHostControl> hosts,
                                  IInMemoryEndpointConfiguration configuration)
            : base(hosts, configuration)
        {
            if (inMemoryHost == null)
            {
                throw new ArgumentNullException(nameof(inMemoryHost));
            }
            if (sendTransportProvider == null)
            {
                throw new ArgumentNullException(nameof(sendTransportProvider));
            }

            var busQueueName = GenerateBusQueueName();

            _inputAddress = new Uri(inMemoryHost.Address, $"{busQueueName}");

            InMemoryHost   = inMemoryHost;
            _configuration = configuration;

            var busEndpointSpecification = _configuration.CreateNewConfiguration(ConsumePipe);

            _busEndpointSpecification = new InMemoryReceiveEndpointSpecification(inMemoryHost.Address, busQueueName, sendTransportProvider,
                                                                                 busEndpointSpecification);

            inMemoryHost.ReceiveEndpointFactory = new InMemoryReceiveEndpointFactory(this, sendTransportProvider, configuration);
        }
Example #3
0
 public InMemoryReceiveEndpointFactory(InMemoryBusBuilder builder, ISendTransportProvider sendTransportProvider,
                                       IInMemoryEndpointConfiguration configuration)
 {
     _builder = builder;
     _sendTransportProvider = sendTransportProvider;
     _configuration         = configuration;
 }
        public InMemoryBusConfiguration(IInMemoryTopologyConfiguration topologyConfiguration, Uri baseAddress)
            : base(topologyConfiguration)
        {
            _hostConfiguration        = new InMemoryHostConfiguration(this, baseAddress, topologyConfiguration);
            _busEndpointConfiguration = CreateEndpointConfiguration();

            _busObservers = new BusObservable();
        }
Example #5
0
 public InMemoryReceiveEndpointSpecification(Uri baseAddress, string queueName, ISendTransportProvider sendTransportProvider, IInMemoryEndpointConfiguration configuration)
     : base(configuration)
 {
     _baseAddress           = baseAddress;
     _queueName             = queueName;
     _sendTransportProvider = sendTransportProvider;
     _configuration         = configuration;
 }
Example #6
0
        public InMemoryBusFactoryConfigurator(IInMemoryBusConfiguration configuration, IInMemoryEndpointConfiguration busEndpointConfiguration,
                                              Uri baseAddress = null)
            : base(configuration, busEndpointConfiguration)
        {
            _configuration            = configuration;
            _busEndpointConfiguration = busEndpointConfiguration;

            _inMemoryHostConfiguration = _configuration.CreateHostConfiguration(baseAddress, Environment.ProcessorCount);
        }
        public InMemoryReceiveEndpointConfiguration(IInMemoryHostConfiguration hostConfiguration, string queueName,
                                                    IInMemoryEndpointConfiguration endpointConfiguration)
            : base(hostConfiguration, endpointConfiguration)
        {
            _queueName             = queueName ?? throw new ArgumentNullException(nameof(queueName));
            _endpointConfiguration = endpointConfiguration ?? throw new ArgumentNullException(nameof(endpointConfiguration));

            HostAddress = hostConfiguration?.HostAddress ?? throw new ArgumentNullException(nameof(hostConfiguration.HostAddress));

            InputAddress = new InMemoryEndpointAddress(hostConfiguration.HostAddress, queueName);
        }
Example #8
0
        public InMemoryReceiveEndpointConfiguration(IInMemoryHostConfiguration hostConfiguration, string queueName,
                                                    IInMemoryEndpointConfiguration endpointConfiguration)
            : base(hostConfiguration, endpointConfiguration)
        {
            _hostConfiguration     = hostConfiguration;
            _queueName             = queueName;
            _endpointConfiguration = endpointConfiguration;

            HostAddress  = hostConfiguration.Host.Address;
            InputAddress = new Uri(hostConfiguration.Host.Address, $"{queueName}");
        }
        public InMemoryBusFactoryConfigurator(IInMemoryEndpointConfiguration configuration, Uri baseAddress = null)
            : base(configuration)
        {
            _configuration            = configuration;
            _baseAddress              = baseAddress;
            TransportConcurrencyLimit = Environment.ProcessorCount;

            _baseAddress = baseAddress ?? new Uri("loopback://localhost/");

            _hosts = new BusHostCollection <IBusHostControl>();
        }
        public InMemoryReceiveEndpointTopology(IInMemoryEndpointConfiguration configuration, Uri inputAddress, IMessageSerializer serializer,
                                               ISendTransportProvider sendTransportProvider)
        {
            InputAddress           = inputAddress;
            _configuration         = configuration;
            _serializer            = serializer;
            _sendTransportProvider = sendTransportProvider;

            _sendPipe    = configuration.Send.CreatePipe();
            _publishPipe = configuration.Publish.CreatePipe();

            _sendEndpointProvider    = new Lazy <ISendEndpointProvider>(CreateSendEndpointProvider);
            _publishEndpointProvider = new Lazy <IPublishEndpointProvider>(CreatePublishEndpointProvider);
        }
Example #11
0
        public InMemoryBusFactoryConfigurator(IInMemoryBusConfiguration configuration, IInMemoryEndpointConfiguration busEndpointConfiguration,
                                              Uri baseAddress = null)
            : base(configuration, busEndpointConfiguration)
        {
            _configuration            = configuration;
            _busEndpointConfiguration = busEndpointConfiguration;

            TransportConcurrencyLimit = Environment.ProcessorCount;

            var hostTopology = new InMemoryHostTopology(busEndpointConfiguration.Topology);
            var host         = new InMemoryHost(configuration, TransportConcurrencyLimit, hostTopology, baseAddress ?? new Uri("loopback://localhost/"));

            _inMemoryHost = host;
            _inMemoryHostConfiguration = _configuration.CreateHostConfiguration(host);
        }
        public IInMemoryReceiveEndpointConfiguration CreateReceiveEndpointConfiguration(string queueName, IInMemoryEndpointConfiguration endpointConfiguration)
        {
            if (_hosts.Count == 0)
            {
                throw new ConfigurationException("At least one host must be configured");
            }

            return(new InMemoryReceiveEndpointConfiguration(_hosts[0], queueName, endpointConfiguration));
        }
Example #13
0
 InMemoryEndpointConfiguration(IInMemoryEndpointConfiguration parentConfiguration, IInMemoryTopologyConfiguration topologyConfiguration,
                               IConsumePipe consumePipe = null)
     : base(parentConfiguration, topologyConfiguration, consumePipe)
 {
     _topologyConfiguration = topologyConfiguration;
 }
 InMemoryEndpointConfiguration(IInMemoryEndpointConfiguration parentConfiguration, IInMemoryTopologyConfiguration topologyConfiguration)
     : base(parentConfiguration, topologyConfiguration)
 {
     _topologyConfiguration = topologyConfiguration;
 }