Spring

    [Spring] Spring WebClient의 사용

    [Spring] Spring WebClient의 사용

    Spring 어플리케이션에서 HTTP 요청을 할 땐 주로 RestTemplate 을 사용했었습니다. 하지만 Spring 5.0 버전부터는 RestTemplate 은 유지 모드로 변경되고 향후 deprecated 될 예정입니다. RestTemplate 의 대안으로 Spring 에서는 WebClient 사용을 강력히 권고하고 있으며 다음과 같은 특징을 가지고 있습니다. Non-blocking I/O Reactive Streams back pressure High concurrency with fewer hardware resources Functional-style, fluent API that takes advantage of Java 8 lambdas Synchronous and asynchronous ..

    [Spring] Annotation과 Reflection을 이용한 확장성이 좋은 AOP 만들기

    현재 진행하고 있는 프로젝트에서는 컨트롤러단에 Custom Annotation이 선언 되어 있다. 컨트롤러 Annotation 선언부 @HoyasRegexpValid(returnEmptyClass = ProductSearchResult.class, checkFiledName = "searchWord") Annotation 정의부 @Documented @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface HoyasRegexpValid { String regexp() default "([a-zA-zㄱ-ㅎ|ㅏ-ㅣ|가-힣0-9]+)"; String checkFiledName(); Class returnEmptyCla..

    [Spring] 비동기 프로그래밍 TaskRejectedException

    오늘 진행하고 있는 프로젝트에서 비동기 관련 오류가 발생했다. 해당 프로젝트의 로그를 확인했더니 아래와 같은 Exception을 날리고 있었다. around search is failed. parameter: { *** }, e: org.springframework.core.task.TaskRejectedException: Executor [java.util.concurrent.ThreadPoolExecutor@76e0dac1[Running, pool size = 150, active threads = 10, queued tasks = 38, completed tasks = 118591]] did not accept task: org.springframework.aop.interceptor.AsyncEx..