public SpeedDataRedis(IMqRedis redis) { _redis = redis; }
public ReadOnlyUserRedis(IMqRedis redis) { _redis = redis; }
public WsServerNodeRedis(IMqRedis redis) : base(redis) { }
public CaptchaRedis(IMqRedis redis) { _redis = redis; }
/// <summary> /// 内部完成redis连接的创建和mq交换器、队列的声明以及mq消费者的启动,队列和交换器的绑定由启动的消费者负责。 /// (mq消费者的启动是异步的,不会立即启动,而是在满足了后续的条件后才会启动)。 /// </summary> /// <param name="serverAppType"></param> /// <param name="mqMessagePaths"></param> /// <returns></returns> public static bool Create(ServerAppType serverAppType, AbstractMqMessagePath[] mqMessagePaths, out IMqRedis serverConfig) { serverConfig = null; ConnectionMultiplexer redisConn; try { redisConn = ConnectionMultiplexer.Connect(ServerRoot.HostConfig.RedisConfig); } catch (Exception e) { NTMinerConsole.UserError("连接redis失败"); Logger.ErrorDebugLine(e); return(false); } IConnection mqConn; try { var factory = new ConnectionFactory { HostName = ServerRoot.HostConfig.MqHostName, UserName = ServerRoot.HostConfig.MqUserName, Password = ServerRoot.HostConfig.MqPassword, AutomaticRecoveryEnabled = true, // 默认值也是true,复述一遍起文档作用 TopologyRecoveryEnabled = true // 默认值也是true,复述一遍起文档作用 }; mqConn = factory.CreateConnection(clientProvidedName: serverAppType.GetName()); } catch (Exception e) { NTMinerConsole.UserError("连接Mq失败"); Logger.ErrorDebugLine(e); return(false); } IModel channel = mqConn.CreateModel(); channel.ExchangeDeclare(MqKeyword.NTMinerExchange, ExchangeType.Direct, durable: true, autoDelete: false, arguments: null); StartConsumer(channel, mqMessagePaths); serverConfig = new MqRedis(redisConn, channel); return(true); }
public UserMqSender(IMqRedis mq) { _mq = mq; }
public MinerRedis(IMqRedis redis) : base(redis) { }
public UserRedis(IMqRedis redis) : base(redis) { }
public ReadOnlyWsServerNodeRedis(IMqRedis redis) { _redis = redis; }
public MinerClientMqSender(IMqRedis mq) { _mq = mq; }
public OperationMqSender(IMqRedis mq) { _mq = mq; }
public WsServerNodeMqSender(IMqRedis serverConnection) { _serverConnection = serverConnection; }