OpenSource(181)
-
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 -
k8s 자격증?
온라인 시험이.. 300달러..!!! 개 비싸다 ㅋㅋ 열공하고 회사에서 지원해주면 도전해 볼 만할듯! ㅋㅋ www.cncf.io/certification/cka/ Certified Kubernetes Administrator (CKA) | Cloud Native Computing Foundation The Certified Kubernetes Administrator (CKA) program was created by the Cloud Native Computing Foundation (CNCF), in collaboration with The Linux Foundation, to help develop the Kubernetes ecosystem. www.cncf.io
2020.11.12 -
@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 -
springboot 2.x 이상 springbatch table문제 해결 방법!
id 'org.springframework.boot' version '2.3.2.RELEASE'를 사용 중! 그리고 springbatch개발을 하고 있다! 그런데? 스프링배치를 수행하면서 아래의 오류 발생~~! bad SQL grammar [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]; nested exception is java.sql.SQLSyntaxErrorException: Table 'BATCH_JOB_INSTANCE' doesn't exist 스프링배치는 수행관련 내용들을 메타데이터로 남겨서 테이블에 저장하는데 해당 테이블 스키마를 생성하지 않아서 문제가 되었다. https..
2020.08.13