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); }
public Publisher(QueueConfig _queueConfig) { queue = QueueFactory.CreateClient(_queueConfig, false); }
public Publisher(Microsoft.Extensions.Options.IOptions <QueueConfig> options) { queue = QueueFactory.CreateClient(options.Value, false); }