OpenSource/Spring(22)
-
Spring Cloud Contract
https://spring.io/projects/spring-cloud-contract Spring Cloud Contract is an umbrella project holding solutions that help users in successfully implementing the Consumer Driven Contracts approach 위의 내용은 spring.io에 spring cloud contract 설명을 한 내용인데 내용중에 Consumer Driven Contracts라는 내용이 나온다. 한글로 번역하면 "소비자 주도 계약" 이것은 무엇을 말하는걸까? 제공자(Producer) 가 소비자(Consumer)에 대한 연동을 확인하면서 모듈화된 시스템 구성 요소를 TEST하는데 사용되는 ..
2022.08.03 -
Jackson Annotation Examples
@JsonInclude 어노테이션 속성을 제외 하는데 사용. ex) JSONObject _connects가 null인 경우에 제외! @JsonInclude(JsonInclude.Include.NON_NULL) private JSONObject _connects; @JsonIgnoreProperties 클래스 레벨의 어노테이션이고 무시할 속성을 표시 @JsonIgnoreProperties({ "id" }) public class BeanWithIgnore { public int id; public String name; } id는 무시되는걸 알수 있다. @Test public void whenSerializingUsingJsonIgnoreProperties_thenCorrect() throws JsonPr..
2020.11.17 -
@Retryable
특정 Exception이 발생하면 일정 횟수만큼 재시도 할 수 있는 어노테이션이다. @EnableRetry 작성.(configuration 등) 재시도 하고 싶은 메소드에 @Retryable 작성. include : 특정 Exception이 발생할 때 retry exclude : 설정 된 Exception 재시도 제외 maxAttempts : 최대 재시도 횟수(default 3회) backoff : 재시도 pause 시간 ex) FailedStoreException 발생 시 최대 5번 시도! delay 10 @Retryable(value = { FailedStoreException.class }, maxAttempts = 5, backoff = @Backoff(delay = 10)) 참고 // // So..
2020.11.17 -
@PreDestory란?
이 메소드는 소멸 메소드이며 이전 @PostConstruct와 상반된 개념이다. JSR-250 스펙에 따라 구현 되었다. (걍 자바에서 사용하려면 또는 springframework 2.5미만 버전에서는 javax.annotation 패키지 관련 라이브러리가 필요 함.) Springframework 2.5부터는 사용 가능! 현재 프로젝트에서는 @PostConstruct와 @PreDestory만 사용하고 있다. 하지만 찾아보니 여러가지 방법이 존재했다. 아래의 멋진 사이트를 참고하면 된다. 정리 및 공유 감사용! madplay.github.io/post/spring-bean-lifecycle-methods 그 중 흥미로운 테스트가 있었는데 바로 생성자/소멸자 호출 순서 테스트이다. import javax.a..
2020.11.12 -
@PostConstruct란?
@PostConstruct? javax.annotation Annotation Type PostConstruct @Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface PostConstruct The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization. This method MUST be invoked before the class is put into service. This annotation MUST be supported on..
2020.11.10 -
Spring WebFlux
toby님이 회사에 오셨다.스프링캠프 2017을 등록 못해서 못갔는데 다행히 좋은 강의를 들을수 있어서 좋았다. 강의자료 : Spring WebFlux 람다식 추가 : 구 Spring web reactive 용도 서비스간 호출이 많은 마이크로서비스 아키텍처에 적합.비동기 - 논블럭킹 개발방식.성능을 뛰어나게 만들겠다.기존 @MVC 방식, 새로운 방식서블릿 스택과 api에서 탈피블록킹, 논블록킹동기, 비동기와는 관점이 다름.내가 직접 제어할 수 없는 대상을 상대하는 방법대상이 제한적임IO멀티 쓰레드 동기화 함수형 스타일의 콜백 방식 스프링 웹 1. 요청 매핑 2. 요청 바인딩 3. 핸들러 실행 4. 핸들러 결과 처리(응답 생성) WebFlux Router Function - 1. 요청매핑 (.route()..
2017.04.26