개발 기록
-
MSA - Spring Cloud Gateway개발 기록 2023. 4. 21. 14:25
지난 MSA블로그에서 구성 중 유레카 서버와 설정 서버를 만들었다. - (유레카) https://neunggu.tistory.com/16 - (설정서버) https://neunggu.tistory.com/18 이번에는 게이트 웨이를 만들어 유레카와 설정서버를 연결한다. 코드는 깃허브에 있다. (https://github.com/neunggu/msa-gateway) GitHub - neunggu/msa-gateway Contribute to neunggu/msa-gateway development by creating an account on GitHub. github.com 1. build.gradle에 dependency 추가 dependencies { // 설정 서버 implementation 'or..
-
MSA - Spring Cloud Config server개발 기록 2023. 4. 11. 12:05
지난 MSA 블로그에서는 유레카 간단히 유레카 서버를 만들었다. (https://neunggu.tistory.com/16) MSA - Spring Cloud Eureka server 스프링 부트에서는 유레카 서버를 아주 간단히 만들 수 있다. 코드는 깃허브에 있다.(https://github.com/neunggu/msa_eureka) GitHub - neunggu/msa_eureka: eureka server eureka server. Contribute to neunggu/msa_eureka development b neunggu.tistory.com 이번에는 설정 서버를 만들어 유레카에 추가한다. 코드는 깃허브에 있다.(https://github.com/neunggu/msa-config-server)..
-
MSA - Spring Cloud Eureka server개발 기록 2023. 4. 9. 15:12
스프링 부트에서는 유레카 서버를 아주 간단히 만들 수 있다. 코드는 깃허브에 있다.(https://github.com/neunggu/msa-eureka) GitHub - neunggu/msa-eureka: eureka server eureka server. Contribute to neunggu/msa-eureka development by creating an account on GitHub. github.com 1. build.gradle에 dependency 추가 dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server' implementation 'org.springframew..
-
Spring Boot[2.x.x] is not compatible with this Spring Cloud release train개발 기록 2023. 4. 3. 23:31
Description: Your project setup is incompatible with our requirements due to following reasons: - Spring Boot [2.7.6] is not compatible with this Spring Cloud release train Action: Consider applying the following actions: - Change Spring Boot version to one of the following versions [2.6.x] . You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn]. If you..
-
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration개발 기록 2023. 3. 27. 16:05
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test 테스트 코드를 실행시키다 만난 오류이다. 원인 @SpringBootApplication 이 붙어있는 메인 클래스와 @SpringBootTest가 붙어있는 테스트 코드의 패키지명이 달라서 생긴 오류였다. (패키지명 수정중이었다.) 해결 패키지명을 일치시킨다.
-
DB 이중화하기 with Spring AOP개발 기록 2023. 3. 19. 15:12
목표 데이터 베이스를 이중화하여 슬레이브에서 select를 하려고 한다. 코드는 github에 있다.(https://github.com/neunggu/score.git) GitHub - neunggu/score Contribute to neunggu/score development by creating an account on GitHub. github.com 환경 java 17 spring boot 2.7.6 spring-boot-starter-aop 사용 방법 1. 마스터, 슬레이브 2개의 DataSource를 생성해 AbstractRoutingDataSource에 담는다. (세션에 접속할 db를 선정해 두고 사용할 예정) (determineCurrentLookupKey 구현 필요) @Configur..
-
Spring AOP에서 만난 예상치 못한 오류 --enable-preview개발 기록 2023. 3. 15. 11:39
Spring에서 Aspect 작성 중(끝난 후) 만난 예상치 못한 오류에 대한 정리이다. 1. 환경 java 17 spring boot 2.7.6 spring-boot-start-aop 사용 intelliJ 사용 2. 오류 내용 로컬에서 실행은 되지만 jar 파일 생성시 테스트실패 오류가 나타난다. ../../target/surefire-reports를 확인해보라고 빨간 글자가 나타난다. 대충 내용을 요약하면 Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.675 s "defalut"; }; ... } } 오류를 발생시킨 부분은 새로운 switch 문법이었다. (java12부터 도입) java 17을 적용시켜놨는데 aspect에서는 새..
-
r2dbc-pool. R2dbcNonTransientResourceException: Connection validation failed개발 기록 2023. 3. 14. 12:50
지난 기록에서 webflux + jwt(es256) 을 구현하던중 db의 연결에서 문제가 발생되었던 부분이 있다. 환경, 증상, 원인, 해결방법에 대해 정리한다. 코드는 github에 있다.( https://github.com/neunggu/auth ) GitHub - neunggu/auth: auth server auth server. Contribute to neunggu/auth development by creating an account on GitHub. github.com 1. 관련된 환경 java 17 spring boot 2.7.6 spring-boot-starter-data-r2dbc ( r2dbc-pool: 0.9.2 포함) r2dbc-mariadb:1.0.3 postman을 이용한 ..
-
Webflux + Jwt(es256)개발 기록 2023. 3. 14. 02:34
웹플럭스 기반의 jwt인증 서버를 구현하며 문제가 됐던 부분 위주의 정리이고, 개인적인 의견이다. 코드는 github에 있다.( https://github.com/neunggu/auth ) GitHub - neunggu/auth: auth server auth server. Contribute to neunggu/auth development by creating an account on GitHub. github.com 1. ReactiveAuthenticationManager를 꼭 구현해야하는가? ** 결론부터 이야기하면 jwt를 구현하는데 있어서 굳이 따 구현할 필요는 없다. 먼저 AbstractUserDetailsReactiveAuthenticationManager에서 authenicate를 구현..