public static void SendMessage(string redisserverip, string channal, BusinessMQNetCommand command) { var manager = new XXF.Redis.RedisManager(); using (var c = manager.GetPoolClient(redisserverip, 1, 1)) { var i = c.GetClient().PublishMessage(channal, new XXF.Serialization.JsonHelper().Serializer(command)); } }
/// <summary> /// 可丢消息发送,当前消息并发情况下丢弃 /// </summary> /// <param name="mqpath"></param> public void SendMessage(string mqpath) { messagelock.Lock(() => { try { var manager = new XXF.Redis.RedisManager(); using (var c = manager.GetPoolClient(redisServerIp, SystemParamConfig.Redis_MaxConnectPoolSize, SystemParamConfig.Redis_MaxConnectPoolSize)) { var i = c.GetClient().PublishMessage(SystemParamConfig.Redis_Channel_Quque + "." + mqpath, "1"); } } catch (Exception exp) { } }); }
/// <summary> /// 可丢消息发送,当前消息并发情况下丢弃 /// </summary> /// <param name="mqpath"></param> public void SendMessage(string mqpath) { messagelock.Lock(() => { try { var manager = new XXF.Redis.RedisManager(); using (var c = manager.GetPoolClient(redisServerIp, SystemParamConfig.Redis_MaxConnectPoolSize, SystemParamConfig.Redis_MaxConnectPoolSize)) { var i = c.GetClient().PublishMessage(SystemParamConfig.Redis_Channel_Quque + "." + mqpath, "1"); } } catch (Exception exp) { } }); }