您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324
  1. using Microsoft.Extensions.Logging;
  2. using Newtonsoft.Json;
  3. using NearCardAttendance.Service.MessageQueue.Kafka;
  4. using NearCardAttendance.Service.MessageQueue.Model;
  5. namespace NearCardAttendance.Service.MessageQueue
  6. {
  7. public class MqProcessLogic
  8. {
  9. private readonly ILogger<MqProcessLogic> _logger;
  10. private readonly KafkaService _serviceKafka;
  11. public MqProcessLogic(ILogger<MqProcessLogic> logger, KafkaService serviceKafka)
  12. {
  13. _logger = logger;
  14. _serviceKafka = serviceKafka;
  15. }
  16. public async Task ProcessIMEIEventMessageAsync(EventData eventData)
  17. {
  18. await _serviceKafka.PublishAsync(eventData.TopicName, eventData);
  19. _logger.LogInformation($"推送消息 {eventData.MessageId} 内容:{JsonConvert.SerializeObject(eventData)}");
  20. }
  21. }
  22. }