Skip to content

Commit

Permalink
refactor: CRM_LISTENER_POOL 할당
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jan 14, 2025
1 parent e23043a commit 1e2c4ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 1e2c4ae

Please sign in to comment.