Ejemplo n.º 1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public RabbitMQServer()
 {
     context = new RabbitMQClientContext();
     context.ListerConnection = RabbitMQClientFactory.CreateConnection();
     context.ListerConnection.ConnectionShutdown += ListerConnection_ConnectionShutdown;
     context.ListerChannel = RabbitMQClientFactory.CreateChannel(context.ListerConnection);
     //在MQ上定义一个队列
     context.ListerChannel.QueueDeclare(context.RabbitMQQueueName, false, false, false, null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public RabbitMQClient()
 {
     context = new RabbitMQClientContext();
     context.SendConnection = RabbitMQClientFactory.CreateConnection();
     context.SendChannel    = RabbitMQClientFactory.CreateChannel(context.SendConnection);
     //在MQ上定义一个队列
     context.SendChannel.QueueDeclare(
         context.RabbitMQQueueName,
         context.QueueDurable,
         context.QueueExclusive,
         context.QueueAutoDelete,
         null);
 }