Spring @Async를 사용하여 비동기 처리 (+ 쓰기, 읽기 서비스 분리)


• Spring @Async is used for asynchronous processing in Spring projects, utilizing thread pools.
• It can be used to handle large amounts of data and improve performance, but private methods cannot be used with @Async.
• @Async 어노테이션을 사용한 메서드는 inner method나 self-invocation이 불가능하다.
• @Async 메서드를 테스트할 때는 비동기 처리가 끝날 때까지 대기하는 코드를 작성해야 하며, 대기 시간은 비동기 메서드의 실행 시간과 복잡성, 호출 위치, 테스트 환경 등에 따라 결정된다.

북마크
공유하기
신고하기