public WorkerParseData(string domain) : base(RabbitMQManager.GetRabbitMQServer(ConfigStatic.KeyRabbitMqCrlProductProperties), ConfigStatic.GetQueueParse(domain), false) { var domainModule = new DomainModule(); var kernel = new StandardKernel(domainModule); _handlerParserProperties = kernel.Get <IHandlerParserProperties>(); _handlerParserProperties.Init(domain); }
public static void PushParseFromNoSql(IEnumerable <string> domains) { NoSqlAdapter noSqlAdapter = NoSqlAdapter.GetInstance(); foreach (var domain in domains) { Task.Factory.StartNew(() => { int iCount = 0; var producerBasicWaitPs = new ProducerBasic(RabbitMQManager.GetRabbitMQServer(ConfigStatic.KeyRabbitMqCrlProductProperties), ConfigStatic.GetQueueParse(domain)); noSqlAdapter.ProcessAllIdProductByCompany(domain, (obj, productId) => { iCount++; producerBasicWaitPs.PublishString(new JobParse() { Id = productId }.GetJson()); if (iCount % 10 == 0) { log.Info(string.Format("Pushed {0} mss of {1}", iCount, domain)); } }); log.Info(string.Format("Pushed all data for company {0} {1}", domain, iCount)); }); } Thread.Sleep(10000000); }
public void Init(string domain) { this._domain = domain; this._producerBasic = new ProducerBasic(RabbitMQManager.GetRabbitMQServer(ConfigStatic.KeyRabbitMqCrlProductProperties), ConfigStatic.GetQueueParse(this._domain)); this._config = _storageConfigCrl.GetConfig(this._domain); }