From 7a2f4f9ce6168489f9ee513c655fda707c4cfe7c Mon Sep 17 00:00:00 2001 From: crocusia Date: Tue, 2 Sep 2025 18:27:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat=20:=20=EB=AC=B8=EC=A0=9C=20=EC=B6=9C?= =?UTF-8?q?=EC=A0=9C=20=EC=8B=A4=ED=8C=A8=20=EC=8B=9C,=20=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EB=B0=9C=EC=86=A1=20=EC=8B=A4=ED=8C=A8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=A0=80=EC=9E=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/component/processor/MailConsumerAsyncProcessor.java | 4 ++++ cs25-batch/src/main/resources/application.properties | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) 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; } diff --git a/cs25-batch/src/main/resources/application.properties b/cs25-batch/src/main/resources/application.properties index c663307f..f8f0a218 100644 --- a/cs25-batch/src/main/resources/application.properties +++ b/cs25-batch/src/main/resources/application.properties @@ -43,4 +43,6 @@ server.forward-headers-strategy=framework #mail mail.strategy=sesMailSender #mail.strategy=javaBatchMailSender -server.error.whitelabel.enabled=false \ No newline at end of file +server.error.whitelabel.enabled=false + +spring.batch.job.name = mailConsumerAsyncJob \ No newline at end of file From bd04cb606f8002f528ebac8bdbcbfd648a34afaf Mon Sep 17 00:00:00 2001 From: crocusia Date: Tue, 2 Sep 2025 18:29:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EC=9A=A9=20=EC=84=A4=EC=A0=95=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cs25-batch/src/main/resources/application.properties | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cs25-batch/src/main/resources/application.properties b/cs25-batch/src/main/resources/application.properties index f8f0a218..c663307f 100644 --- a/cs25-batch/src/main/resources/application.properties +++ b/cs25-batch/src/main/resources/application.properties @@ -43,6 +43,4 @@ server.forward-headers-strategy=framework #mail mail.strategy=sesMailSender #mail.strategy=javaBatchMailSender -server.error.whitelabel.enabled=false - -spring.batch.job.name = mailConsumerAsyncJob \ No newline at end of file +server.error.whitelabel.enabled=false \ No newline at end of file