diff --git a/src/Altinn.Notifications.Integrations/Kafka/Consumers/EmailStatusConsumer.cs b/src/Altinn.Notifications.Integrations/Kafka/Consumers/EmailStatusConsumer.cs index f019223d..a33cd2a4 100644 --- a/src/Altinn.Notifications.Integrations/Kafka/Consumers/EmailStatusConsumer.cs +++ b/src/Altinn.Notifications.Integrations/Kafka/Consumers/EmailStatusConsumer.cs @@ -1,4 +1,5 @@ -using Altinn.Notifications.Core.Models.Notification; +using Altinn.Notifications.Core.Integrations.Interfaces; +using Altinn.Notifications.Core.Models.Notification; using Altinn.Notifications.Core.Services.Interfaces; using Altinn.Notifications.Integrations.Configuration; @@ -13,14 +14,22 @@ namespace Altinn.Notifications.Integrations.Kafka.Consumers; public class EmailStatusConsumer : KafkaConsumerBase { private readonly IEmailNotificationService _emailNotificationsService; + private readonly IKafkaProducer _producer; + private readonly string _topicName; /// /// Initializes a new instance of the class. /// - public EmailStatusConsumer(IEmailNotificationService emailNotificationsService, IOptions settings, ILogger logger) + public EmailStatusConsumer( + IEmailNotificationService emailNotificationsService, + IKafkaProducer producer, + IOptions settings, + ILogger logger) : base(settings, logger, settings.Value.EmailStatusUpdatedTopicName) { _emailNotificationsService = emailNotificationsService; + _producer = producer; + _topicName = settings.Value.EmailStatusUpdatedTopicName; } /// @@ -43,7 +52,6 @@ private async Task ProcessOrder(string message) private async Task RetryOrder(string message) { - // Retry logic - back to kafka? - await Task.CompletedTask; + await _producer.ProduceAsync(_topicName, message!); } } \ No newline at end of file