//TODO:判断连接失败
        public static WorkQueueProducer createInstance(IRabbitMqFactory factory, string queueName)
        {
            WorkQueueProducer instance = new WorkQueueProducer();

            instance.mConnection = factory.CreateConnection();
            instance.mChannel    = instance.mConnection.CreateChannel();
            instance.mQueueName  = queueName;
            return(instance);
        }
Esempio n. 2
0
 public IMQProducer CreateMqProducer(string routingKey)
 {
     return((IMQProducer)(WorkQueueProducer.createInstance(this, routingKey)));
 }