|
- using Microsoft.Extensions.Logging;
- using Newtonsoft.Json;
- using NearCardAttendance.Service.MessageQueue.Kafka;
- using NearCardAttendance.Service.MessageQueue.Model;
-
- namespace NearCardAttendance.Service.MessageQueue
- {
- public class MqProcessLogic
- {
- private readonly ILogger<MqProcessLogic> _logger;
-
- private readonly KafkaService _serviceKafka;
- public MqProcessLogic(ILogger<MqProcessLogic> logger, KafkaService serviceKafka)
- {
- _logger = logger;
- _serviceKafka = serviceKafka;
- }
- public async Task ProcessIMEIEventMessageAsync(EventData eventData)
- {
- await _serviceKafka.PublishAsync(eventData.TopicName, eventData);
- _logger.LogInformation($"推送消息 {eventData.MessageId} 内容:{JsonConvert.SerializeObject(eventData)}");
- }
- }
- }
|