Example #1
0
        public static AbsQueue CreateClient(QueueConfig config, bool async)
        {
            AbsQueue instance = null;

            switch (config.MQType)
            {
            case MQType.RabbitMQ:
                instance = new Queue.RabbitMQ(config, async);
                break;

            case MQType.Redis:
                instance = new Queue.Redis(config);
                break;

            case MQType.MongoDb:
                instance = new Queue.MongoDb(config);
                break;
            }
            return(instance);
        }
Example #2
0
 public Publisher(QueueConfig _queueConfig)
 {
     queue = QueueFactory.CreateClient(_queueConfig, false);
 }
Example #3
0
 public Publisher(Microsoft.Extensions.Options.IOptions <QueueConfig> options)
 {
     queue = QueueFactory.CreateClient(options.Value, false);
 }