From 1e2c4ae817ddaa958a59cd002032a7a2b7dd7bb2 Mon Sep 17 00:00:00 2001 From: belljun3395 <195850@jnu.ac.kr> Date: Tue, 14 Jan 2025 18:15:42 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20CRM=5FLISTENER=5FPOOL=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/few/crm/email/event/schedule/ScheduledEventListener.kt | 3 ++- .../com/few/crm/email/event/send/EmailSendEventListener.kt | 3 ++- .../event/send/NotificationEmailSendTimeOutEventListener.kt | 3 ++- .../email/event/template/EventTemplateTransactionListener.kt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/domain/crm/src/main/kotlin/com/few/crm/email/event/schedule/ScheduledEventListener.kt b/domain/crm/src/main/kotlin/com/few/crm/email/event/schedule/ScheduledEventListener.kt index d01da11ea..efdc9b915 100644 --- a/domain/crm/src/main/kotlin/com/few/crm/email/event/schedule/ScheduledEventListener.kt +++ b/domain/crm/src/main/kotlin/com/few/crm/email/event/schedule/ScheduledEventListener.kt @@ -1,5 +1,6 @@ package com.few.crm.email.event.schedule +import com.few.crm.config.CrmThreadPoolConfig.Companion.CRM_LISTENER_POOL import com.few.crm.email.event.schedule.handler.CancelScheduledEventHandler import com.few.crm.support.jpa.CrmTransactional import org.springframework.context.event.EventListener @@ -11,7 +12,7 @@ import org.springframework.transaction.annotation.Propagation class ScheduledEventListener( private val cancelScheduledEventHandler: CancelScheduledEventHandler, ) { - @Async + @Async(CRM_LISTENER_POOL) @EventListener @CrmTransactional(propagation = Propagation.REQUIRES_NEW) fun onCancelEvent(event: CancelScheduledEvent) { diff --git a/domain/crm/src/main/kotlin/com/few/crm/email/event/send/EmailSendEventListener.kt b/domain/crm/src/main/kotlin/com/few/crm/email/event/send/EmailSendEventListener.kt index ce32a23b3..0f11f8693 100644 --- a/domain/crm/src/main/kotlin/com/few/crm/email/event/send/EmailSendEventListener.kt +++ b/domain/crm/src/main/kotlin/com/few/crm/email/event/send/EmailSendEventListener.kt @@ -1,5 +1,6 @@ package com.few.crm.email.event.send +import com.few.crm.config.CrmThreadPoolConfig.Companion.CRM_LISTENER_POOL import com.few.crm.email.event.send.handler.* import com.few.crm.email.relay.send.EmailSendEventMessageMapper import com.few.crm.support.jpa.CrmTransactional @@ -18,7 +19,7 @@ class EmailSendEventListener( private val emailDeliveryDelayEventHandler: EmailDeliveryDelayEventHandler, private val emailSendEventMessageMapper: EmailSendEventMessageMapper, ) { - @Async + @Async(CRM_LISTENER_POOL) @EventListener @CrmTransactional(propagation = Propagation.REQUIRES_NEW) fun onEvent(event: EmailSendEvent) { diff --git a/domain/crm/src/main/kotlin/com/few/crm/email/event/send/NotificationEmailSendTimeOutEventListener.kt b/domain/crm/src/main/kotlin/com/few/crm/email/event/send/NotificationEmailSendTimeOutEventListener.kt index 8cd35f987..04876cb8c 100644 --- a/domain/crm/src/main/kotlin/com/few/crm/email/event/send/NotificationEmailSendTimeOutEventListener.kt +++ b/domain/crm/src/main/kotlin/com/few/crm/email/event/send/NotificationEmailSendTimeOutEventListener.kt @@ -1,5 +1,6 @@ package com.few.crm.email.event.send +import com.few.crm.config.CrmThreadPoolConfig.Companion.CRM_LISTENER_POOL import com.few.crm.email.event.send.handler.NotificationEmailSendTimeOutEventHandler import com.few.crm.email.event.send.handler.NotificationEmailSendTimeOutInvokeEventHandler import com.few.crm.support.jpa.CrmTransactional @@ -13,7 +14,7 @@ class NotificationEmailSendTimeOutEventListener( private val notificationEmailSendTimeOutEventHandler: NotificationEmailSendTimeOutEventHandler, private val notificationEmailSendTimeOutInvokeEventHandler: NotificationEmailSendTimeOutInvokeEventHandler, ) { - @Async + @Async(CRM_LISTENER_POOL) @EventListener @CrmTransactional(propagation = Propagation.REQUIRES_NEW) fun onEvent(event: NotificationEmailSendTimeOutEvent) { diff --git a/domain/crm/src/main/kotlin/com/few/crm/email/event/template/EventTemplateTransactionListener.kt b/domain/crm/src/main/kotlin/com/few/crm/email/event/template/EventTemplateTransactionListener.kt index b4804caf0..7e6408dc5 100644 --- a/domain/crm/src/main/kotlin/com/few/crm/email/event/template/EventTemplateTransactionListener.kt +++ b/domain/crm/src/main/kotlin/com/few/crm/email/event/template/EventTemplateTransactionListener.kt @@ -1,5 +1,6 @@ package com.few.crm.email.event.template +import com.few.crm.config.CrmThreadPoolConfig.Companion.CRM_LISTENER_POOL import com.few.crm.email.event.template.handler.PostEmailTemplateEventHandler import com.few.crm.support.jpa.CrmTransactional import org.springframework.scheduling.annotation.Async @@ -12,7 +13,7 @@ import org.springframework.transaction.event.TransactionalEventListener class EventTemplateTransactionListener( private val postEmailTemplateEventHandler: PostEmailTemplateEventHandler, ) { - @Async + @Async(CRM_LISTENER_POOL) @CrmTransactional(propagation = Propagation.REQUIRES_NEW) @TransactionalEventListener(phase = TransactionPhase.AFTER_COMPLETION) fun handleAfterCompletionEvent(event: EmailTemplateTransactionAfterCompletionEvent) {