private FullRedis InitFullRedis(RedisMQOptions options)
        {
            try
            {
                FullRedis fullRedis = null;
                if (string.IsNullOrEmpty(options.Config))
                {
                    fullRedis = new FullRedis(options.Server, options.Password, options.Db);
                }
                else
                {
                    fullRedis = new FullRedis();
                    fullRedis.Init(options.Config);
                }

                fullRedis.Timeout = options.Timeout;
                return(fullRedis);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "初始化Redis失败!");
                Console.WriteLine(e);
                throw;
            }
        }
Ejemplo n.º 2
0
 public RedisMQConsumerClient(string queueName,
                              IConnectionChannelPool connectionChannelPool,
                              IOptions <RedisMQOptions> options)
 {
     _queueName             = queueName;
     _connectionChannelPool = connectionChannelPool;
     _redisMQOptions        = options.Value;
     _channel             = connectionChannelPool.Rent();
     _redisReliableQueues = new List <RedisReliableQueue <string> >();
 }