-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): 메일전송을 비동기로 처리한다. (#513)
* feat: 이메일 전송 Async로 동작하도록 수정 * refactor: paymentInfo NoArgs추가 * refactor: index.html 현재 결제 API 맞춰 변경 * refactor: index.html 현재 결제 API 맞춰 변경 * refactor: mailExecutor Bean 등록 * refactor: newFixedThreadPool를 사용하도록 변경
- Loading branch information
Showing
4 changed files
with
50 additions
and
28 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
server/src/main/java/com/example/tyfserver/common/config/AsyncConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.tyfserver.common.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.CustomizableThreadFactory; | ||
|
||
import java.util.concurrent.Executors; | ||
import java.util.concurrent.ThreadPoolExecutor; | ||
|
||
@Configuration | ||
@EnableAsync | ||
public class AsyncConfig { | ||
|
||
@Bean(name = "mailExecutor") | ||
public ThreadPoolExecutor mailExecutor() { | ||
return (ThreadPoolExecutor) Executors.newFixedThreadPool(5, | ||
new CustomizableThreadFactory("mail-executor")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
server/src/main/java/com/example/tyfserver/payment/domain/PaymentInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters