본문 바로가기

개발/SpringBoot13

Spring WebClient / objectMappper WebClient? 웹으로 API 를 호출하기 위해 사용되는 Http Client 모듈 중 하나이다. WebClient 는 Non-Blocking 방식의 Single Thread 방식을 사용한다. Blocking vs Non-Blocking ? Blocking 은 요청하고 응답이 올 때 까지 기다리는 방식이다. Non-Blocking 은 요청하고 응답이 오기 전까지 다른 일을 하다가 응답이 오면 결과를 읽어 처리하는 방식이다. 동기(Synchronous) vs 비동기(Asynchronous) ? 동기 Synchronous : 직렬적으로 task 수행. 순차적으로 진행. 작업이 수행중이면 다음 작업은 대기한다. 비동기 Asynchronous : 병렬적으로 task 수행. 대기하지 않고 응답이 올 때 까지 .. 2022. 6. 27.
[SpringBoot] @NotNull @NotEmpty @NotBlank 차이점 ✔ 회원가입 시 Null 값 허용하고 싶지 않을 때 @NotNull NotNull 은 null 만 허용하지 않는다. 따라서 "" , " " 같이 빈 값은 허용한다. @NotEmpty Not Empty 는 null 과 ""를 허용하지 않는다. 따라서 " " 와 값은 빈 값은 허용한다. @NotBlank NotBlank 는 null, "", " " 모두 허용하지 않는다. ✔ 참고 https://sanghye.tistory.com/36 [Spring Boot] @NotNull, @NotEmpty, @NotBlank 의 차이점 및 사용법 개발하시는 API 의 request parameter 의 null 체크를 어떻게 하고 계신가요? 대부분 별도의 null 체크 util 을 사용하거나, Controlle.. 2022. 6. 15.
[SpringBoot] application.yml - h2 database server: port: 8080 servlet: context-path: / encoding: charset: UTF-8 enabled: true force: true spring: datasource: # url: jdbc:h2:tcp://localhost/~/test // local url: jdbc:h2:mem:testdb // in-memory driver-class-name: org.h2.Driver username: sa password: initialize: true h2: console: enabled: true sql: init: mode: always schema-locations: classpath*:schema.sql jpa: # defer-datasource-initializat.. 2022. 6. 3.
@Autowired 필드 주입 , private final 생성자 주입 차이 https://jackjeong.tistory.com/41 [Spring] 생성자 주입 vs 필드 주입 (@Autowired) 안녕하세요~ 잭코딩입니다! 이번에는 스프링 프레임워크에서 의존성을 주입하는 방법을 살펴보고 어떤 방식으로 주입하는 게 좋은지 살펴볼까요? 우선 결론부터 말하자면 생성자 주입 (Constructo jackjeong.tistory.com 2022. 5. 31.