본문 바로가기

전체 글

(6)
Spring Webflux filter 로직 살펴보기 Problemspring webflux 에서 logging, exception handling 을 위해서 filter 로직을 넣고자 했습니다. 로깅은 분석을 위해서 request body 와 response body 를 같이 기록하고자 하였고, exception 같은 경우 exception filter 에서 잡아 약속된 error 응답 형식으로 내려주고자 하였습니다. 또한 exception filter 가 먼저 수행되도록 하여 exception 이 발생한 request 도 기록할 수 있도록 filter 의 순서도 고려 대상이었습니다. webflux 에는 controller annotation 방식, router 방식 두가지가 있으며, webfilter, handlerFilterFunction 등 두 방식..
spring webflux, kotlin coroutine 환경에서 aop 사용해보기 Background) Spring reactive cacheThis topic is still relatively new. At the time of writing this article, there was no fluent integration between @Cacheable and reactive frameworks. The primary issue is that there are no non-blocking cache implementations (JSR-107 cache API is blocking). Only Redis is providing a reactive driver.Despite the issue we mentioned in the previous paragraph, we can st..
[gRPC][java][k8s] client side load balancing 열심히 해보기 Problem) 왜 gRPC server 마다 부하가 다르지? k8s 클러스터 환경에서 공통 로직을 grpc server 로 분리하여 구동하고 각기 다른 애플리케이션 client 들이 k8s service 로 묶인 endpoint 를 사용하여 grpc server 에게 요청을 보내고 있었습니다. k8s service 로 묶여 있고 round-robin 으로 요청을 분배한다고 알고 있었기에 모든 grpc server 들이 동일한 부하를 받을 것이라 생각했습니다. 하지만, 각 grpc server 받는 부하는 달랐으며 client 와 맺은 connection 의 개수도 약간 다름을 metric 을 통해 확인했고 부하를 많이 받는 grpc server 에 연결되 애플리케이션 서버에서 지연이 발생하였습니다. W..