문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 마지막 판 양쪽 다음 판 | ||
springframework:async [2021/11/12 13:03] kwon37xi |
springframework:async [2022/06/28 15:44] kwon37xi [MdcTaskDecorator.java] |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
- | * 비동기 작업시 [[springframework: | + | |
+ | | ||
===== 설정 ===== | ===== 설정 ===== | ||
줄 22: | 줄 23: | ||
===== ThreadPoolTaskExecutor 설정 ===== | ===== ThreadPoolTaskExecutor 설정 ===== | ||
* [[java: | * [[java: | ||
- | * wait 설정으로 서버 종료시 남은 작업을 기다릴 시간 확보 아래를 안해주면 서버가 그냥 종료 돼 버린다. | + | * wait 설정으로 서버 종료시 남은 작업을 기다릴 시간 확보해야함. |
* '' | * '' | ||
* '' | * '' | ||
줄 28: | 줄 29: | ||
* [[https:// | * [[https:// | ||
* fixed? cached? | * fixed? cached? | ||
+ | * 서버 종료시 올바로 종료됨을 보장하려면 [[springframework: | ||
+ | |||
===== Cached Thread Pool 효과 ===== | ===== Cached Thread Pool 효과 ===== | ||
* corePoolSize 는 적게 혹은 0, maxPoolSize='' | * corePoolSize 는 적게 혹은 0, maxPoolSize='' | ||
줄 74: | 줄 77: | ||
// Right now: @Async thread context ! | // Right now: @Async thread context ! | ||
// (Restore the Web thread context' | // (Restore the Web thread context' | ||
- | MDC.setContextMap(contextMap); | + | |
+ | | ||
+ | } | ||
runnable.run(); | runnable.run(); | ||
} finally { | } finally { |