Exemple #1
0
        /// <summary>
        /// 单个消息处理
        /// </summary>
        /// <param name="message"></param>
        private static void SingleDataHandler(RMqSendMessage message)
        {
            if (LongRunRabbitProducer.IsAlive())
            {
                bool result = LongRunRabbitProducer.SendMessage(message, ex =>
                {
                    NLogHelper.Error($"id={message.Id}的消息处理失败:{ex}");
                });

                if (result)
                {
                }
                else
                {
                }
            }
            else
            {
                NLogHelper.Error($"mq连接异常,消息id={message.Id}的消息发送失败");
            }
        }
Exemple #2
0
        /// <summary>
        /// 列表发送
        /// </summary>
        /// <param name="msgList"></param>
        private static void DataListHandler(List <RMqSendMessage> msgList)
        {
            if (LongRunRabbitProducer.IsAlive())
            {
                bool result = LongRunRabbitProducer.SendMessage(msgList, ex =>
                {
                    NLogHelper.Error($"{msgList.Count}条消息处理失败:{ex}");
                });

                if (result)
                {
                }
                else
                {
                }
            }
            else
            {
                NLogHelper.Error($"mq连接异常,{msgList.Count}条消息发送失败");
            }
        }