using System; using System.Collections.Generic; using Library; using System.Linq; using System.Threading; using RabbitMQ.Client; using System.Text; namespace MySystem { public class MpMerchantActService { public readonly static MpMerchantActService Instance = new MpMerchantActService(); private MpMerchantActService() { } public void Start() { Thread th = new Thread(dosomething); th.IsBackground = true; th.Start(); } public void dosomething() { while (true) { string content = MpRedisDbconn.Instance.RPop("MpMerchantActQueue"); if (!string.IsNullOrEmpty(content)) { try { // RabbitMQClient.Instance.SendMsg2(content, "QUEUE_LKB_ACT_DIVISION"); } catch (Exception ex) { Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "商家激活异常"); } } else { Thread.Sleep(500); } } } } }