コード例 #1
0
 public ConsumerService(IKafkaService kafkaService, IRedisService redisService, ILogger <ConsumerService> logger)
 {
     _kafkaService = kafkaService;
     _redisService = redisService;
     _logger       = logger;
     _logger.LogDebug("Background service constructor.");
 }
コード例 #2
0
        private CustomizationLogger CreateLoggerImplementation(string name)
        {
            var           includeScopes = _includeScopes;
            IKafkaService kafkaService  = _services.GetService <IKafkaService>();

            return(new  CustomizationLogger(name, null
                                            , includeScopes? _scopeProvider: null, _prix, _logStoreTopic, kafkaService));
        }
コード例 #3
0
 public KafkaToElasticsearch(ILoggerFactory logFact, IConfiguration config
                             , IElasticsearchService elasticsearch
                             , IKafkaService kafkaService)
 {
     _logFact       = logFact;
     _config        = config;
     _elasticsearch = elasticsearch;
     _kafkaService  = kafkaService;
 }
コード例 #4
0
        internal CustomizationLogger(string name, Func <string, LogLevel, bool> filter
                                     , IExternalScopeProvider scopeProvider, string prix, string logStoreTopic
                                     , IKafkaService kafkaService)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            _kafkaService = kafkaService;

            Name           = name;
            Filter         = filter ?? ((category, logLevel) => true);
            ScopeProvider  = scopeProvider;
            _prix          = prix;
            _logStoreTopic = logStoreTopic;

            Task.Run(() => {
                try
                {
                    System.Diagnostics.Debug.WriteLine("kafka开始同步日志。");
                    foreach (var entityMess in blockColl.GetConsumingEnumerable())
                    {
                        var task = _kafkaService.Producer(_logStoreTopic
                                                          , entityMess.Id, entityMess);
                        if (task == null)
                        {
                            throw new NullReferenceException("方法没有返回有效的task");
                        }

                        //System.Diagnostics.Debug.WriteLine("即将执行kafka日志Producer");
                        var result = task.Result;
                        //Console.WriteLine(_prix+"--"+ logBuilder.ToString());
                    }
                }
                catch (Exception ep)
                {
                    System.Diagnostics.Debug.WriteLine("kafka同步出现问题,详细情况:{0}", ep.ToString());
                    blockColl.CompleteAdding();
                }
            });
        }
コード例 #5
0
 public CarController(ILogger <CarController> logger, IKafkaService kafkaService)
 {
     _logger           = logger;
     this.kafkaService = kafkaService;
 }
コード例 #6
0
 public ValuesController(IKafkaService kafkaService, IZookeeperService zookeeperService)
 {
     _kafkaService     = kafkaService;
     _zookeeperService = zookeeperService;
 }
コード例 #7
0
 public App(IKafkaService kafkaService)
 {
     this._kafkaService = kafkaService;
 }
コード例 #8
0
 public ValuesController(IKafkaService kafkaService, IConfiguration config)
 {
     _kafkaService = kafkaService;
 }
コード例 #9
0
 public Worker(ILogger <Worker> logger, IKafkaService kafkaService)
 {
     _logger       = logger;
     _kafkaService = kafkaService;
 }
コード例 #10
0
 public ServiceConsumer(ILogger <ServiceConsumer> logger, IKafkaService kafkaService)
 {
     _logger       = logger;
     _kafkaService = kafkaService;
 }
コード例 #11
0
 public CustomersController(ICustomerService customerService, IKafkaService kafkaService)
 {
     _customerService = customerService;
     _kafkaService    = kafkaService;
 }
コード例 #12
0
 public CustomizationLogger(string name, Func <string, LogLevel, bool> filter
                            , IExternalScopeProvider scopeProvider, bool includeScopes, string prix, string logStoreTopic, IKafkaService kafkaService)
     : this(name, filter, includeScopes ? new LoggerExternalScopeProvider() : null
            , prix, logStoreTopic, kafkaService)
 {
 }
コード例 #13
0
 public PessoaEventHandler(IKafkaService kafkaService)
 {
     _kafkaService = kafkaService;
 }
コード例 #14
0
 public FlightEventProducer(IKafkaService kafkaService, IMessageSerializer messageSerializer)
 {
     _kafkaService      = kafkaService;
     _messageSerializer = messageSerializer;
 }
コード例 #15
0
 public ProduceController(IKafkaService service)
 {
     _service = service;
 }
コード例 #16
0
 public ProducerController(IConfiguration configuration, IKafkaService kafkaService)
 {
     _configuration = configuration;
     _kafkaService  = kafkaService;
 }
コード例 #17
0
 public MessageController(IMessageService service, IKafkaService evenBusKafka, IUserConversationService userConversationService)
 {
     _service                 = service;
     _evenBusKafka            = evenBusKafka;
     _userConversationService = userConversationService;
 }