Exemple #1
0
        public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, IInMemoryHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration = hostConfiguration;

            _messageFabric = new MessageFabric(hostConfiguration.TransportConcurrencyLimit);
        }
        public InMemoryTransportProvider(IInMemoryHostConfiguration hostConfiguration, IInMemoryTopologyConfiguration topologyConfiguration)
        {
            _hostConfiguration     = hostConfiguration;
            _topologyConfiguration = topologyConfiguration;

            _messageFabric = new Lazy <IMessageFabric>(() => new MessageFabric(hostConfiguration.TransportConcurrencyLimit));
        }
        public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, IInMemoryHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration = hostConfiguration;

            Add(hostConfiguration.TransportProvider);
        }
        public InMemoryBusFactoryConfigurator(IInMemoryBusConfiguration busConfiguration)
            : base(busConfiguration)
        {
            _busConfiguration  = busConfiguration;
            _hostConfiguration = busConfiguration.HostConfiguration;

            busConfiguration.BusEndpointConfiguration.Consume.Configurator.AutoStart = true;
        }
        public InMemoryBusConfiguration(IInMemoryTopologyConfiguration topologyConfiguration, Uri baseAddress)
            : base(topologyConfiguration)
        {
            _hostConfiguration        = new InMemoryHostConfiguration(this, baseAddress, topologyConfiguration);
            _busEndpointConfiguration = CreateEndpointConfiguration();

            _busObservers = new BusObservable();
        }
Exemple #6
0
        public InMemoryBusFactoryConfigurator(IInMemoryBusConfiguration configuration, IInMemoryEndpointConfiguration busEndpointConfiguration,
                                              Uri baseAddress = null)
            : base(configuration, busEndpointConfiguration)
        {
            _configuration            = configuration;
            _busEndpointConfiguration = busEndpointConfiguration;

            _inMemoryHostConfiguration = _configuration.CreateHostConfiguration(baseAddress, Environment.ProcessorCount);
        }
Exemple #7
0
        public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, IInMemoryHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration = hostConfiguration;

            _messageFabric = new MessageFabric(hostConfiguration.TransportConcurrencyLimit);

            var cache = new GreenCache <InMemorySendTransport>(hostConfiguration.SendTransportCacheSettings);

            _index = cache.AddIndex("exchangeName", x => x.ExchangeName);
        }
        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);
        }
Exemple #9
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}");
        }
Exemple #10
0
        public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, int concurrencyLimit)
            : base(hostConfiguration)
        {
            _hostConfiguration = hostConfiguration;

            _messageFabric = new MessageFabric(concurrencyLimit);

            var cacheSettings = new CacheSettings(10000, TimeSpan.FromMinutes(1), TimeSpan.FromHours(24));

            var cache = new GreenCache <InMemorySendTransport>(cacheSettings);

            _index = cache.AddIndex("exchangeName", x => x.ExchangeName);
        }
Exemple #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);
        }
Exemple #12
0
        public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, int concurrencyLimit, IHostTopology topology, Uri baseAddress = null)
        {
            _hostConfiguration = hostConfiguration;
            Topology           = topology;
            Address            = baseAddress ?? new Uri("loopback://localhost/");

            _messageFabric = new MessageFabric(concurrencyLimit);

            _receiveEndpoints = new ReceiveEndpointCollection();
            Add(_receiveEndpoints);

            var cacheSettings = new CacheSettings(10000, TimeSpan.FromMinutes(1), TimeSpan.FromHours(24));

            var cache = new GreenCache <InMemorySendTransport>(cacheSettings);

            _index = cache.AddIndex("exchangeName", x => x.ExchangeName);
        }
Exemple #13
0
 public InMemoryHost(IInMemoryHostConfiguration hostConfiguration, IInMemoryHostTopology hostTopology)
     : base(hostConfiguration, hostTopology)
 {
     _hostConfiguration = hostConfiguration;
 }
 public InMemoryReceiveEndpointBuilder(IInMemoryHostConfiguration hostConfiguration, IInMemoryReceiveEndpointConfiguration configuration)
     : base(configuration)
 {
     _hostConfiguration = hostConfiguration;
     _configuration     = configuration;
 }
Exemple #15
0
 public InMemoryReceiveEndpointContext(IInMemoryHostConfiguration hostConfiguration, IInMemoryReceiveEndpointConfiguration configuration)
     : base(hostConfiguration, configuration)
 {
     _hostConfiguration = hostConfiguration;
 }
Exemple #16
0
 public InMemoryHostTopology(IInMemoryHostConfiguration hostConfiguration, IInMemoryTopologyConfiguration configuration)
     : base(hostConfiguration, configuration)
 {
     _configuration = configuration;
 }
 public bool TryGetHost(Uri address, out IInMemoryHostConfiguration host)
 {
     return(_hosts.TryGetHost(address, out host));
 }