public RabbitMqHost(IRabbitMqHostConfiguration hostConfiguration) : base(hostConfiguration) { _hostConfiguration = hostConfiguration; ConnectionRetryPolicy = Retry.CreatePolicy(x => { x.Handle <RabbitMqConnectionException>(); x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3)); }); ConnectionContextSupervisor = new RabbitMqConnectionContextSupervisor(hostConfiguration); }
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); }