public RabbitMqHostConfiguration(IRabbitMqBusConfiguration busConfiguration, IRabbitMqTopologyConfiguration topologyConfiguration) : base(busConfiguration) { _busConfiguration = busConfiguration; _hostSettings = new ConfigurationHostSettings { Host = "localhost", VirtualHost = "/", Port = 5672, Username = "******", Password = "******" }; var messageNameFormatter = new RabbitMqMessageNameFormatter(); _hostTopology = new RabbitMqHostTopology(this, messageNameFormatter, _hostSettings.HostAddress, topologyConfiguration); ReceiveTransportRetryPolicy = Retry.CreatePolicy(x => { x.Handle <ConnectionException>(); x.Handle <MessageNotConfirmedException>(exception => exception.Message.Contains("CONNECTION_FORCED")); x.Ignore <AuthenticationFailureException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); _connectionContext = new Recycle <IConnectionContextSupervisor>(() => new ConnectionContextSupervisor(this, topologyConfiguration)); }
public RabbitMqHost(IRabbitMqHostConfiguration hostConfiguration, IRabbitMqHostTopology hostTopology) : base(hostConfiguration, hostTopology) { _hostConfiguration = hostConfiguration; _hostTopology = hostTopology; Add(hostConfiguration.ConnectionContextSupervisor); }
public ConnectionContextFactory(IRabbitMqHostConfiguration configuration, IRabbitMqHostTopology hostTopology) { _configuration = configuration; _hostTopology = hostTopology; _description = configuration.Settings.ToDescription(); _connectionFactory = new Lazy <ConnectionFactory>(_configuration.Settings.GetConnectionFactory); }
public ConnectionContextFactory(RabbitMqHostSettings settings, IRabbitMqHostTopology topology) { _settings = settings; _topology = topology; _description = settings.ToDebugString(); _connectionFactory = new Lazy <ConnectionFactory>(settings.GetConnectionFactory); }
public RabbitMqHostConfiguration(IRabbitMqBusConfiguration busConfiguration, RabbitMqHostSettings hostSettings, IRabbitMqHostTopology hostTopology) { _busConfiguration = busConfiguration; _hostSettings = hostSettings; _hostTopology = hostTopology; _host = new RabbitMqHost(this); Description = FormatDescription(hostSettings); }
public RabbitMqConnectionCache(RabbitMqHostSettings settings, IRabbitMqHostTopology topology, ITaskSupervisor supervisor) { _settings = settings; _topology = topology; _connectionFactory = new Lazy <ConnectionFactory>(settings.GetConnectionFactory); _description = settings.ToDebugString(); _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<RabbitMqConnectionCache>.ShortName} - {_description}", CloseScope); }
public RabbitMqConnectionContext(IConnection connection, RabbitMqHostSettings hostSettings, IRabbitMqHostTopology topology, string description, CancellationToken cancellationToken) : base(new PayloadCache(), cancellationToken) { _connection = connection; HostSettings = hostSettings; Topology = topology; Description = description; _taskScheduler = new LimitedConcurrencyLevelTaskScheduler(1); connection.ConnectionShutdown += OnConnectionShutdown; }
public RabbitMqHost(RabbitMqHostSettings settings, IRabbitMqHostTopology topology) { _settings = settings; _topology = topology; var exceptionFilter = Retry.Selected <RabbitMqConnectionException>(); ReceiveEndpoints = new ReceiveEndpointCollection(); _connectionRetryPolicy = exceptionFilter.Exponential(1000, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(1)); _supervisor = new TaskSupervisor($"{TypeMetadataCache<RabbitMqHost>.ShortName} - {_settings.ToDebugString()}"); _connectionCache = new RabbitMqConnectionCache(settings, _topology, _supervisor); }
public RabbitMqHost(IRabbitMqHostConfiguration hostConfiguration, IRabbitMqHostTopology hostTopology) : base(hostConfiguration, hostTopology) { _hostConfiguration = hostConfiguration; _hostTopology = hostTopology; ConnectionRetryPolicy = Retry.CreatePolicy(x => { x.Handle <RabbitMqConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); ConnectionContextSupervisor = new RabbitMqConnectionContextSupervisor(hostConfiguration, hostTopology); }
public ConnectionContextFactory(IRabbitMqHostConfiguration configuration, IRabbitMqHostTopology hostTopology) { _configuration = configuration; _hostTopology = hostTopology; _description = configuration.Settings.ToDescription(); _connectionRetryPolicy = Retry.CreatePolicy(x => { x.Handle <RabbitMqConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); _connectionFactory = new Lazy <ConnectionFactory>(_configuration.Settings.GetConnectionFactory); }
public RabbitMqConnectionContext(IConnection connection, IRabbitMqHostConfiguration configuration, IRabbitMqHostTopology hostTopology, string description, CancellationToken cancellationToken) : base(cancellationToken) { _connection = connection; Description = description; HostAddress = configuration.HostAddress; PublisherConfirmation = configuration.PublisherConfirmation; Topology = hostTopology; StopTimeout = TimeSpan.FromSeconds(30); _taskScheduler = new LimitedConcurrencyLevelTaskScheduler(1); connection.ConnectionShutdown += OnConnectionShutdown; }
public RabbitMqHost(IRabbitMqBusConfiguration busConfiguration, RabbitMqHostSettings settings, IRabbitMqHostTopology topology) { _settings = settings; _topology = topology; ReceiveEndpoints = new ReceiveEndpointCollection(); ConnectionRetryPolicy = Retry.CreatePolicy(x => { x.Handle <RabbitMqConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); ConnectionCache = new RabbitMqConnectionCache(settings, _topology); ReceiveEndpointFactory = new RabbitMqReceiveEndpointFactory(busConfiguration, this); }
public RabbitMqHostConfiguration(IRabbitMqBusConfiguration busConfiguration, IRabbitMqTopologyConfiguration topologyConfiguration) : base(busConfiguration) { _busConfiguration = busConfiguration; _hostSettings = new ConfigurationHostSettings { Host = "localhost", VirtualHost = "/", Port = 5672, Username = "******", Password = "******" }; var exchangeTypeSelector = topologyConfiguration.Publish.ExchangeTypeSelector; var messageNameFormatter = new RabbitMqMessageNameFormatter(); _hostTopology = new RabbitMqHostTopology(this, exchangeTypeSelector, messageNameFormatter, _hostSettings.HostAddress, topologyConfiguration); _connectionContext = new Recycle <IConnectionContextSupervisor>(() => new ConnectionContextSupervisor(this, topologyConfiguration)); }
public RabbitMqConnectionContext(IConnection connection, IRabbitMqHostConfiguration configuration, IRabbitMqHostTopology hostTopology, string description, CancellationToken cancellationToken) : base(cancellationToken) { _connection = connection; Description = description; HostAddress = configuration.HostAddress; PublisherConfirmation = configuration.PublisherConfirmation; BatchSettings = configuration.BatchSettings; Topology = hostTopology; StopTimeout = TimeSpan.FromSeconds(30); _executor = new ChannelExecutor(1); connection.ConnectionShutdown += OnConnectionShutdown; }
public RabbitMqHost(IRabbitMqHostConfiguration hostConfiguration, IRabbitMqHostTopology hostTopology) : base(hostConfiguration, hostTopology) { _hostConfiguration = hostConfiguration; _hostTopology = hostTopology; ConnectionRetryPolicy = Retry.CreatePolicy(x => { x.Handle <RabbitMqConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); ConnectionContextSupervisor = new RabbitMqConnectionContextSupervisor(hostConfiguration, hostTopology); var cacheSettings = new CacheSettings(SendEndpointCacheDefaults.Capacity, SendEndpointCacheDefaults.MinAge, SendEndpointCacheDefaults.MaxAge); var cache = new GreenCache <CachedSendTransport>(cacheSettings); _index = cache.AddIndex("key", x => x.Address); }
public RabbitMqConnectionCache(RabbitMqHostSettings settings, IRabbitMqHostTopology topology) : base(new ConnectionContextFactory(settings, topology)) { _description = settings.ToDebugString(); }
public DelayedExchangeMessageScheduler(ISendEndpointProvider sendEndpointProvider, IRabbitMqHostTopology topology, Uri hostAddress) { _sendEndpointProvider = sendEndpointProvider; _topology = topology; _hostAddress = hostAddress; }
public DelayedExchangeScheduleMessageProvider(ISendEndpointProvider sendEndpointProvider, IRabbitMqHostTopology topology) { _sendEndpointProvider = sendEndpointProvider; _topology = topology; }
public RabbitMqConnectionContext(IConnection connection, RabbitMqHostSettings hostSettings, IRabbitMqHostTopology topology, string description, ITaskSupervisor supervisor) : this(connection, hostSettings, description, supervisor.CreateParticipant($"{TypeMetadataCache<RabbitMqConnectionContext>.ShortName} - {description}")) { Topology = topology; }
public RabbitMqConnectionContextSupervisor(IRabbitMqHostConfiguration configuration, IRabbitMqHostTopology hostTopology) : base(new ConnectionContextFactory(configuration, hostTopology)) { _description = configuration.Description; }
public RabbitMqHost(IRabbitMqHostConfiguration hostConfiguration, IRabbitMqHostTopology hostTopology) : base(hostConfiguration, hostTopology) { _hostConfiguration = hostConfiguration; Topology = hostTopology; }