728x90 반응형 SMALL listenablefuture exception handling1 @Async, @Scheduled, ListenableFuture Exception handling 별도의 Thread 로 동작하는 method 에서 발생하는 예외는 어떻게 처리해야 할까? 적절한 처리가 없을 경우 오류 발생 시 로그조차 기록되지 않아 큰 문제가 될 수 있다. @Async - Async annotation 을 이용할 경우 보통 AsyncConfigurer 를 implements 하여 Thread-pool 을 정의 해 주는 것이 좋다. - AsyncConfigurer 를 implements 할 때 getAsyncUncaughtExceptionHandler 를 Override 하여 작성한다. @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return (ex, method, params) .. 2022. 3. 28. 이전 1 다음 728x90 반응형 LIST