책책책 책을 읽읍시다
-
스프링으로 시작하는 리액티브 프로그래밍 3 : WebFlux와 R2DBC책책책 책을 읽읍시다/프로그래밍 2024. 8. 9. 22:04
Chapter 15. Spring WebFlux 개요 Spring WebFlux는 리액티브 웹 애플리케이션 구현을 위해 Spring 5.0부터 지원하는 리액티브 웹 프레임워크다.Spring MVC의 기술 스택과 Spring WebFlux의 기술 스택을 비교해 보면서 Spring WebFlux의 기술과 Spring MVC 기술에 어떤 차이점이 있는지 간단하게 살펴보자.서버 : Spring MVC 프레임워크는 서블릿 기반의 프레임워크이기 때문에 아팣치 톰캣 같은 서블릿 컨테이너에서 Blocking I/O 방식으로 동작한다. 반면에 Spring WebFlux 프레임워크는 Non-Blocking I/O 방식으로 동작하는 Netty 등의 서버 엔진에서 동작한다.서버 API : Spring MVC 프레임워크는 서블..
-
스프링으로 시작하는 리액티브 프로그래밍 1 : 리액티브 입문과 Non-Blocking I/O책책책 책을 읽읍시다/프로그래밍 2024. 8. 5. 23:15
저자 : 황정식들어가며 리액티브 프로그래밍과 Spring WebFlux에 대해 부담없는 수준으로 알려주는 책이다. 개인적으로는 리액티브 프로그래밍에 대해 개념과 간단한 동작원리를 알 수 있어서 나쁘지 않았다. 다만, 이 한권으로 완벽히는 다 못가져갈 것 같고, 나도 다 읽기는 했지만 자바 ORM 표준 JPA 프로그래밍 때처럼 이 기술에 대해 어느정도 감을 잡은 것 같다라는 자신감은 얻지 못했다. Chapter 01. 리액티브 시스템과 리액티브 프로그래밍 'reactive'의 사전적 의미에는 '반응을 하는'이라는 뜻이 있는데, 어떤 이벤트나 상황이 발생했을 때, 반응을 해서 그에 따라 적절하게 행동하는 것을 의미한다. 리액티브 시스템에서 반응을 잘한다는 것은 클라이언트의 요청에 머뭇거리지 않고 반응을 잘해..
-
SCS(Spring Cloud Stream) 뽀개기2 - 스프링 가이드 무작정 따라하기책책책 책을 읽읍시다/프로그래밍 2024. 5. 27. 23:52
들어가며 우리 팀에서 각 MSA간 REST API 콜로 강결합되어 있던 코드들을 이벤트 드리븐 방식으로 하나씩 떼어내는 작업을 했다. 이 중 가장 큰 문제는 failover 처리가 전혀되어 있지 않다는 점이다. 아직 베타 단계라 트래픽이 적어서 드러나는 문제는 없지만 잠재적으로 이슈들이 터져나올 딱 좋은 환경이다. 프로젝트 완성도가 높지 않다는 변명만 해대고 있는 중이다 ㅠㅠ 아무튼 그래서 최소한의 에러 처리는 해두기로 했다. 가장 쉬운 방법은 전 회사에서 처럼 컨슈머(kafka) 빈마다 try-catch로 감싸는 것이다. 여기에는 2가지 문제가 있다. 첫째, 컨슈머가 10개쯤은 되는데 다 try-catch로 감싸기 껄끄럽다. 센트리(Sentry)에도 알람을 보내야되고 ES 로그로 수집되게 로깅 작업도 ..
-
스프링 가이드 - docker build책책책 책을 읽읍시다/프로그래밍 2024. 2. 14. 22:51
들어가며 저번 글(https://baby-care-dev.tistory.com/65)에서는 간단한 RESTful API를 만들어보았다. 이번엔 이 프로젝트를 docker 이미지로 빌드해서 코드와 환경설정 등을 다른 사람들도 그대로 가져다 쓸 수 있게 해보자. 그래야 같은 설정으로 각기 다른 엔드포인트들을 테스트해볼 수 있으니까 말이다. 준비물 실행할 스프링부트 application 도커 엔진 : 편하게 Docker Desktop 스프링 가이드 : https://spring.io/guides/topicals/spring-boot-docker#a-better-dockerfile Dockerfile 이란? 이미지를 빌드하는 스크립트라고 보면 된다. 크게 아래와 같은 내용을 기술하며 자세한 내용은 공식 가이드(..
-
개발자의 글쓰기 - 릴리스 노트, 장애 보고서책책책 책을 읽읍시다/프로그래밍 2023. 8. 11. 22:25
고객에게 유용한 정보를 쓰자 개발자 관점과 고객 관점 체인지 로그는 개발자가 변경한 내용을 적은 것이다. 하지만 체인지 로그를 보는 독자는 뭔가 새로운 것, 바뀐 것, 그래서 자기에게 좋거나 유익하거나 어떤 행동을 해야 할지 명확하게 지시하는 것을 보고 싶어 한다. 체인지 로그를 사내 개발자끼리만 본다면 한 일만 담백하게 적어도 상관없다. 하지만 외부 개발자나 일반 사용자가 보는 체인지 로그를 쓸 때는 개발자 관점이 아니라 고객 관점에서 써야 한다. 고객 관점으로 쓰려면 변경사항이 고객에게 끼치는 영향을 체인지 로그에 추가해서 기술하면 된다. 예를 들어 다음과 같이 개발자가 문제를 해결한 내용만 기술한 체인지 로그가 있다고 하자. 댓글에서 애니메이션 스티커 때문에 화면이 멈추는 문제를 해결했습니다. 이것..
-
개발자의 글쓰기 - 에러 메시지책책책 책을 읽읍시다/프로그래밍 2023. 8. 11. 21:39
에러 메시지의 목적은 사용자에게 에러가 났음을 알려주는 것이 아니라 사용자 스스로 에러를 해결하게 하는 것이다. 따라서 사용자 에러 메시지에는 에러의 내용, 에러의 원인, 에러 해결 방법이 포한돼야 한다. 에러 내용 : 오류로 인한 문제와 종류 에러의 원인 : 오류를 발생시킨 직접적이고 근본적인 원인 에러 해결 방법 : 사용자가 오류를 해결할 가장 쉽고 빠른 방법 회원 가입 중 휴대전화 번호를 01012345678 형식으로 입력해야되는데, 010-1234-5678로 잘못 입력한 경우에 위 규칙을 적용해보자. [에러 내용] 회원가입을 진행할 수 없습니다. [에러 원인] 휴대전화 번호를 잘못 입력하셨습니다. [에러 해결 방법] 휴대전화 번호 입력란에는 숫자만 입력하십시오. 에러 메시지를 보여주는 순서 에러 ..
-
개발자의 글쓰기 - 문장과 단락을 구조화하는 법책책책 책을 읽읍시다/프로그래밍 2023. 8. 8. 23:44
저자 : 김철수 들어가며 개발자로서 직업인으로서 갖추어야 할 글쓰기 방법에 대해 쉽게 알려주는 책이다. 토비의 스프링같이 완독 자체로도 의미있는 그런 난이도 있는 책을 읽고 난 뒤 머리를 식힐겸 읽어도 좋을 책이다. 신입때 이전 직장에 있을 때는 개발자가 코드만 잘 짜면 되는줄 알았다. 개발이란 작업을 코드로 구현하는 위주로 접근했던 때이다. 이직을 하고 난 뒤 생각이 바뀌어 개발에 대해 다시 고민하기 시작했고, PO, 디자이너, 동료 개발자, QA 등 제품과 관련된 모든 이해관계자와의 소통, 업무 지식 문서화와 같은 소프트 스킬이 개발의 반을 이룬다는 것을 깨달았다. 소프트 스킬이 부족하면 업무 성과가 나올수가 없다. 이번 책은 소프트 스킬 중 문서를 잘 작성하기 위한 기술적인 가이드를 해준다. 변수 ..
-
엘레강트 오브젝트 : Mock 대신 Fake 사용책책책 책을 읽읍시다/프로그래밍 2023. 8. 4. 00:09
단위 테스트에서 Mock은 객체 의존 관계를 대신해주기 때문에 편리하다. 특히 repository에 의존하는 service나 domain을 테스트할 때 repository 의존성을 대신해주어 속도도 빠르고 복잡한 데이터를 조사할 필요도 없어진다. 하지만 과도하게 사용할 경우 테스트가 장황해지고 리팩터링 내성이 저하된다. Fake는 이런 문제를 해결해준다. 다음 자기 자신을 새로운 환율로 변환할 수 있는 Cash 클래스를 보자. public class Cash { private final Exchange exchange; private final int amount; public Cash(Exchange exchange, int amount) { this.exchange = exchange; this.am..