public ConnectionChannelPool(ILogger <ConnectionChannelPool> logger, RabbitMQOptions options) { _logger = logger; _maxSize = DefaultPoolSize; _connectionActivator = CreateConnection(options); }
public RabbitMQConsumerClient(string queueName, RabbitMQOptions options) { _queueName = queueName; _rabbitMQOptions = options; _exchageName = options.TopicExchangeName; InitClient(); }
public PublishQueueExecutor(ILogger <PublishQueueExecutor> logger, CapOptions options, RabbitMQOptions rabbitMQOptions, IConnectionChannelPool connectionChannelPool, IStateChanger stateChanger) : base(options, stateChanger, logger) { _logger = logger; _connectionChannelPool = connectionChannelPool; _rabbitMQOptions = rabbitMQOptions; }
public PublishQueueExecutor(IStateChanger stateChanger, IOptions <RabbitMQOptions> options, ILogger <PublishQueueExecutor> logger) : base(stateChanger, logger) { _logger = logger; _rabbitMQOptions = options.Value; }
public RabbitMQConsumerClient(string queueName, IConnectionChannelPool connectionChannelPool, IOptions <RabbitMQOptions> options) { _queueName = queueName; _connectionChannelPool = connectionChannelPool; _rabbitMQOptions = options.Value; _exchangeName = connectionChannelPool.Exchange; }
public RabbitMQPublishMessageSender(ILogger <RabbitMQPublishMessageSender> logger, CapOptions options, IStorageConnection connection, IConnectionChannelPool connectionChannelPool, IStateChanger stateChanger, RabbitMQOptions mqOptions) : base(logger, options, connection, stateChanger) { _logger = logger; _connectionChannelPool = connectionChannelPool; _exchange = _connectionChannelPool.Exchange; ServersAddress = _connectionChannelPool.HostAddress; _rabbitMQOptions = mqOptions; }
public ConnectionChannelPool(ILogger <ConnectionChannelPool> logger, RabbitMQOptions options) { _logger = logger; _maxSize = DefaultPoolSize; _connectionActivator = CreateConnection(options); HostAddress = options.HostName + ":" + options.Port; Exchange = options.ExchangeName; }
public RabbitMQConsumerClient(string queueName, IConnectionChannelPool connectionChannelPool, RabbitMQOptions options) { _queueName = queueName; _connectionChannelPool = connectionChannelPool; _rabbitMQOptions = options; _exchageName = options.ExchangeName; InitClient(); }
public PublishQueueExecutor( CapOptions options, IStateChanger stateChanger, IConnection connection, RabbitMQOptions rabbitMQOptions, ILogger <PublishQueueExecutor> logger) : base(options, stateChanger, logger) { _logger = logger; _connection = connection; _rabbitMQOptions = rabbitMQOptions; }
public ConnectionChannelPool(ILogger <ConnectionChannelPool> logger, RabbitMQOptions options) { _logger = logger; _maxSize = DefaultPoolSize; _pool = new ConcurrentQueue <IModel>(); _connectionActivator = CreateConnection(options); HostAddress = options.HostName + ":" + options.Port; Exchange = options.ExchangeName; _logger.LogDebug("RabbitMQ configuration of CAP :\r\n {0}", JsonConvert.SerializeObject(options, Formatting.Indented)); }
public RabbitJobProcessor( IOptions <CapOptions> capOptions, IOptions <RabbitMQOptions> rabbitMQOptions, ILogger <RabbitJobProcessor> logger, IServiceProvider provider) { _logger = logger; _rabbitMqOptions = rabbitMQOptions.Value; _provider = provider; _cts = new CancellationTokenSource(); var capOptions1 = capOptions.Value; _pollingDelay = TimeSpan.FromSeconds(capOptions1.PollingDelay); }
private static Func <IConnection> CreateActivator(RabbitMQOptions options) { var factory = new ConnectionFactory() { HostName = options.HostName, UserName = options.UserName, Port = options.Port, Password = options.Password, VirtualHost = options.VirtualHost, RequestedConnectionTimeout = options.RequestedConnectionTimeout, SocketReadTimeout = options.SocketReadTimeout, SocketWriteTimeout = options.SocketWriteTimeout }; return(() => factory.CreateConnection()); }
private static Func <IConnection> CreateConnection(RabbitMQOptions options) { var factory = new ConnectionFactory { UserName = options.UserName, Port = options.Port, Password = options.Password, VirtualHost = options.VirtualHost }; if (options.HostName.Contains(",")) { options.ConnectionFactoryOptions?.Invoke(factory); return(() => factory.CreateConnection( options.HostName.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries))); } factory.HostName = options.HostName; options.ConnectionFactoryOptions?.Invoke(factory); return(() => factory.CreateConnection()); }
public ConnectionChannelPool(ILogger <ConnectionChannelPool> logger, CapOptions capOptions, RabbitMQOptions options) { _logger = logger; _maxSize = DefaultPoolSize; _pool = new ConcurrentQueue <IModel>(); _connectionActivator = CreateConnection(options); HostAddress = options.HostName + ":" + options.Port; if (CapOptions.DefaultVersion == capOptions.Version) { Exchange = options.ExchangeName; } else { Exchange = options.ExchangeName + "." + capOptions.Version; } _logger.LogDebug($"RabbitMQ configuration:'HostName:{options.HostName}, Port:{options.Port}, UserName:{options.UserName}, Password:{options.Password}, ExchangeName:{options.ExchangeName}'"); }
public ConnectionChannelPool(ILogger <ConnectionChannelPool> logger, CapOptions capOptions, RabbitMQOptions options) { _logger = logger; _maxSize = DefaultPoolSize; _pool = new ConcurrentQueue <IModel>(); _connectionActivator = CreateConnection(options); HostAddress = options.HostName + ":" + options.Port; if (CapOptions.DefaultVersion == capOptions.Version) { Exchange = options.ExchangeName; } else { Exchange = options.ExchangeName + "." + capOptions.Version; } _logger.LogDebug("RabbitMQ configuration of CAP :{0} {1}", Environment.NewLine, JsonConvert.SerializeObject(options, Formatting.Indented)); }
private static Func <IConnection> CreateConnection(RabbitMQOptions options) { var factory = new ConnectionFactory { UserName = options.UserName, Port = options.Port, Password = options.Password, VirtualHost = options.VirtualHost, RequestedConnectionTimeout = options.RequestedConnectionTimeout, SocketReadTimeout = options.SocketReadTimeout, SocketWriteTimeout = options.SocketWriteTimeout }; if (options.HostName.Contains(",")) { return(() => factory.CreateConnection( options.HostName.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries))); } factory.HostName = options.HostName; return(() => factory.CreateConnection()); }
public RabbitMQConsumerClientFactory(RabbitMQOptions rabbitMQOptions, IConnection connection) { _rabbitMQOptions = rabbitMQOptions; _connection = connection; }
public RabbitMQConsumerClientFactory(RabbitMQOptions rabbitMQOptions, ConnectionPool pool) { _rabbitMQOptions = rabbitMQOptions; _connectionPool = pool; }
public ConnectionPool(RabbitMQOptions options) { _maxSize = DefaultPoolSize; _activator = CreateActivator(options); }
public RabbitMQConsumerClientFactory(RabbitMQOptions rabbitMQOptions) { _rabbitMQOptions = rabbitMQOptions; }
public RabbitMQConsumerClientFactory(IOptions <RabbitMQOptions> rabbitMQOptions) { _rabbitMQOptions = rabbitMQOptions.Value; }