using System; using System.Collections.Generic; using Library; using System.Linq; using System.Threading; using RabbitMQ.Client; using System.Text; namespace MySystem { public class MpOrderService { public readonly static MpOrderService Instance = new MpOrderService(); private MpOrderService() { } public void Start() { Thread th = new Thread(dosomething); th.IsBackground = true; th.Start(); } public void dosomething() { while (true) { string content = MpRedisDbconn.Instance.RPop("MpOrderQueue"); if (!string.IsNullOrEmpty(content)) { try { // RabbitMQClient.Instance.SendMsg2(content, "QUEUE_LKB_TRADE_DIVISION"); } catch (Exception ex) { Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "来客吧订单推送异常"); } } else { Thread.Sleep(500); } } } } }