public IInMemoryHostConfiguration CreateHostConfiguration(Uri baseAddress, int transportConcurrencyLimit) { var hostTopology = new InMemoryHostTopology(_topologyConfiguration); var hostConfiguration = new InMemoryHostConfiguration(this, baseAddress, transportConcurrencyLimit, hostTopology); _hosts.Add(hostConfiguration); return(hostConfiguration); }
public InMemoryHostConfiguration(IInMemoryBusConfiguration busConfiguration, Uri baseAddress, IInMemoryTopologyConfiguration topologyConfiguration) : base(busConfiguration) { _busConfiguration = busConfiguration; _hostAddress = baseAddress ?? new Uri("loopback://localhost/"); _hostTopology = new InMemoryHostTopology(this, topologyConfiguration); TransportConcurrencyLimit = Environment.ProcessorCount; TransportProvider = new InMemoryTransportProvider(this, topologyConfiguration); }
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 InMemoryHostConfiguration(IInMemoryBusConfiguration busConfiguration, Uri baseAddress, IInMemoryTopologyConfiguration topologyConfiguration) : base(busConfiguration) { _busConfiguration = busConfiguration; _hostAddress = baseAddress ?? new Uri("loopback://localhost/"); _hostTopology = new InMemoryHostTopology(this, topologyConfiguration); TransportConcurrencyLimit = Math.Min(Environment.ProcessorCount, 4); ReceiveTransportRetryPolicy = Retry.CreatePolicy(x => { x.Handle <ConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); _transportProvider = new Recycle <IInMemoryTransportProvider>(() => new InMemoryTransportProvider(this, topologyConfiguration)); }
static InMemoryReceiveEndpointContext Build() { var topologyConfiguration = new InMemoryTopologyConfiguration(InMemoryBus.MessageTopology); IInMemoryBusConfiguration busConfiguration = new InMemoryBusConfiguration(topologyConfiguration, null); var receiveEndpointConfiguration = busConfiguration.HostConfiguration.CreateReceiveEndpointConfiguration("input-queue"); var hostTopology = new InMemoryHostTopology(busConfiguration.HostConfiguration, topologyConfiguration); var host = new InMemoryHost(busConfiguration.HostConfiguration, hostTopology); var builder = new InMemoryReceiveEndpointBuilder(busConfiguration.HostConfiguration, receiveEndpointConfiguration); if (LogContext.Current == null) { var loggerFactory = new TestOutputLoggerFactory(true); LogContext.ConfigureCurrentLogContext(loggerFactory); } return(builder.CreateReceiveEndpointContext()); }