Пример #1
0
 internal MQServiceBase(MQSetting setting, ILogger logger)
 {
     this.setting = setting;
     this.logger  = logger;
     UserName     = setting.UserName;
     Password     = setting.Password;
     Host         = setting.Host;
     Port         = setting.Port;
     vHost        = setting.vHost;
 }
Пример #2
0
 public LogService(ILogWriter logWriter, FilterService filterService, MQSetting setting, ILogger logger) : base(setting, logger)
 {
     this.logWriter     = logWriter;
     this.filterService = filterService;
     base.vHost         = setting.vHost;
     base.Exchange      = setting.Exchange;
     base.Binds.Add(new BindInfo()
     {
         ExchangeType = setting.ExchangeType,
         Queue        = setting.QueueName,
         RouterKey    = setting.RouteKey,
         OnReceived   = this.SmsLog_OnReceived
     });
 }
Пример #3
0
        public void Start()
        {
            var key      = "TomatoLog:Flow:RabbitMQ";
            var rabbitMQ = cfg.GetSection(key);

            Check.NotNull(rabbitMQ, key);
            MQSetting setting = cfg.GetSection(key).Get <MQSetting>();

            ChannelList = new List <IService>();
            for (int i = 0; i < setting.Channels; i++)
            {
                var ls = new LogService(logWriter, filterService, setting, logger);
                ls.Start();
                ChannelList.Add(ls);
            }
        }