Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            RabbitMQManager.RabbitMQManager rabbitMQManager = new RabbitMQManager.RabbitMQManager(Configuration.UserName, Configuration.Password, Configuration.VirtualHost, Configuration.HostName, Configuration.Port, Configuration.Exchange);
            ListToQueueProcess process       = receiveProcess;
            MQBaseService      mqbaseservice = new MQBaseService(process, rabbitMQManager);

            mqbaseservice.ListenToQueue(Configuration.mq_cps_payment_order_mq, "bindRouting");
            string message = string.Empty;

            do
            {
                message = Console.ReadLine();
                if (!string.IsNullOrEmpty(message))
                {
                    mqbaseservice.SendMessage(Configuration.mq_cps_payment_order_mq, "bindRouting", message);
                }
            }while(!string.IsNullOrEmpty(message));
            Thread.Sleep(1000000000);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="process"></param>
 public MQBaseService(ListToQueueProcess process, RabbitMQManager rabbitMQManager)
 {
     _process         = process;
     _rabbitMQManager = rabbitMQManager;
 }