전체 글
-
FeignClient DecodeException JsonToken.START_OBJECTSpring Framework 2023. 11. 27. 00:01
개요 FeignClient를 사용하다 실수한 부분을 파악하고 공유해보고자 합니다. 에러발생 feign.codec.DecodeException: Error while extracting response for type [java.util.List] and content type [application/json]] with root cause com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`) DecodeException이 발생하였고, 주된 내용으로는 JsonTok..
-
Kafka Consumer를 On Off 할 수 있을까?프로젝트/kafka 2023. 11. 26. 00:01
개요 Kafka를 활용하다가 잠시 DB의 장애가 발생하거나 Applicaion에 문제가 발생하는 경우 DLQ에 수십만 건의 데이터가 쌓여있을 수 있습니다. 이때 DLQ를 off 해두었다가 장애가 복구하면 on을 하여 활용하면 괜찮은 전략이 될 수 있을 것 같아 on, off 방법을 구성해보려 합니다. Kafka Listener autoStartUp @KafkaListener(id="assigned_listener_id", autoStartup = "false", topics = "topic-to-listen-to") public void listen(Message message){ // interesting message processing logic } consumer를 구성할때 autoSartUp을 ..
-
AWS RDS connection 옵션 확인하기AWS 2023. 11. 25. 00:01
개요 [53300] FATAL: remaining connection slots are reserved for non-replication superuser and rds_superuser connections RDS에 접근하기 위해 User와 Password를 입력하였는데 자꾸 이런 에러가 발생했다.. 배포한 서버에서도 connection이 없다는 warn로그가 발생.. 저 에러는 왜 발생하는 거지? aws docs에 따르면 max connection보다 커넥션을 더 생성할 수 없어서 발생합니다. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html#AuroraPostgreSQL.Managin..
-
3장 - 지식 공유책 요약정리/구글 엔지니어는 이렇게 일한다 2023. 11. 24. 00:01
개요 3장을 읽으면서 인상 깊었던 내용들에 대해 간략하게 정리합니다. 배움을 가로막는 장애물들 불이익이 두려워서 위험을 감수하지 않거나 실수를 드러내지 않음 (잘못될 게 두려워서 아무도 손대지 않는 코드) 정보들이 파편화되었고 조직마다 일하는 방식이 달라짐 버스지수와 유사하게 중요한 정보를 한 사람이 독점하여 병목 발생 전문가에게 책임이 집중되고 초심자는 성장하지 못하게 됨 앵무새처럼 따라하지말기 너무 한 사람이 하나의 시스템만 담당하게 되고, 그 사람이 부재하게 되면 해당 시스템을 아는 사람이 없는 것처럼 버스지수를 잘 높여야 한다 멘토, 멘티등의 제도를 활용하여 모르는 건 편하게 물어볼 수 있다는 심리적인 안정감을 형성해 주자 질문하기 초심자가 저지르는 가장 큰 실수는 질문하지 않는 것! "보통은 도..
-
Server Sent Event란? - 이론편프로젝트/Server Sent Event 2023. 11. 23. 00:01
Server Sent Event란? 대게 요청은 클라이언트가 서버에게 요청을 먼저 수행하면 그에 대한 응답을 내려줍니다. 하지만 Server Sent Event를 활용하면 서버에서 필요할 때마다 데이터를 클라이언트로 푸시할 수 있습니다. WebSocket vs Server Sent Event 데이터를 클라이언트로 푸시하는 방안으로는 WebSocket을 활용해볼수도 있습니다. WebSocket은 양방향 전이중 통신을 위해 사용되고 실시간 업데이트와 클라이언트도 데이터를 전송할 때 활용할 수 있습니다. 즉, 양방향이 필요하다면 WebSocket 그렇지 않다면 SSE를 고려해볼 수 있습니다. WebSocket을 활용하면 별도의 프로토콜을 사용하지만 SSE를 활용하면 전통적인 HTTP 프로토콜을 활용합니다. S..
-
Kotlin Synchonized와 MultiThreadKotlin/Kotlin 2023. 11. 22. 00:01
Synchonized란? thread-safe를 위해 Java에서는 synchonized 키워드를 활용하여 data의 안정성과 신뢰성을 보장합니다. kotlin에서는 어떻게 할 수 있을지 알아보겠습니다. SynchonizedCounter 구현 class SynchronizedCounter { private var count = 0 fun increaseCount(){ count++ } fun getCurrentCount(): Int{ return count } } increaseCount를 호출하여 count를 증가시키는 클래스입니다. MultiThread Test @Test fun `kotlin Synchronized 테스트해보기`(){ val counter = SynchronizedCounter() ..
-
Kafka Binder란 무엇인가?프로젝트/kafka 2023. 11. 21. 00:01
개요 Kafka를 Spring Cloud Stream과 함께 사용하다 보면 Kafka Binder라는 개념이 등장하게 됩니다. Kafka Binder란 무엇인가? 를 정리해 보면서 Kafka Binder에 대해서 개념을 잡아보고자 합니다. Spring Cloud란? Spring Cloud는 분산 시스템에서 필요한 다양한 기능들을 추상화하여 제공합니다. 보통 마이크로서비스 아키텍처(MSA)를 구축할 때 유용한 도구를 제공하는 프레임워크입니다. 주요 기능으로는 서비스 디스커버리, 로드밸런싱, Config 관리, 회로 차단, 분산 추적 등이 있습니다. Spring Cloud Stream이란? 이벤트 중심 마이크로 서비스를 구축하기 위한 프레임워크입니다. Spring Cloud Stream은 외부 미들웨어와의 ..
-
Gatling으로 성능테스트 하기성능테스트 2023. 11. 20. 00:01
개요 성능테스트를 편하게 하는 방법을 찾다 보니 Gatling이라는 부하 테스트 도구를 알게 되어 도입 및 적용사례를 공유하고자 합니다. Gatling이란? HTTP 서버 부하 테스트에 적합한 도구로 표현형 DSL을 기반으로 성능테스트를 작성할 수 있습니다. non blocking 방식을 활용하여 가상 사용자를 구현하며 이를 통해 리소스를 저렴하게 사용할 수 있습니다. 수천 명의 가상사용자를 동시에 실행해도 문제가 되지 않습니다. 지원되는 버전 JDK LTS버전에서 지원됨(8, 11, 17) gradle pulgin으로 Setup plugins{ id("io.gatling.gradle") version "3.9.5.1" } gradle 프로젝트에서 간단한 설정을 넣어주면 바로 사용할 수 있습니다. gra..