diff --git a/cs25-batch/src/main/java/com/example/cs25batch/batch/component/processor/MailConsumerAsyncProcessor.java b/cs25-batch/src/main/java/com/example/cs25batch/batch/component/processor/MailConsumerAsyncProcessor.java index c82e21a2..94996c7b 100644 --- a/cs25-batch/src/main/java/com/example/cs25batch/batch/component/processor/MailConsumerAsyncProcessor.java +++ b/cs25-batch/src/main/java/com/example/cs25batch/batch/component/processor/MailConsumerAsyncProcessor.java @@ -2,11 +2,13 @@ import com.example.cs25batch.adapter.RedisStreamsClient; import com.example.cs25batch.batch.dto.MailDto; +import com.example.cs25batch.batch.service.MailLogBatchService; import com.example.cs25batch.batch.service.TodayQuizService; import com.example.cs25entity.domain.quiz.entity.Quiz; import com.example.cs25entity.domain.quiz.exception.QuizException; import com.example.cs25entity.domain.subscription.entity.Subscription; import com.example.cs25entity.domain.subscription.repository.SubscriptionRepository; +import java.time.LocalDateTime; import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -21,6 +23,7 @@ public class MailConsumerAsyncProcessor implements ItemProcessor message) throws Exception { @@ -49,6 +52,7 @@ public MailDto process(Map message) throws Exception { .build(); } catch(QuizException e){ //문제 출제 실패로 인한 예외 발생 시, 기존 Queue에 있는 데이터 삭제 + mailLogBatchService.saveFailLog(subscription, null, LocalDateTime.now(), "No quizzes available"); redisClient.ackAndDel(recordId); return null; }