아낌없이 주는 자바 개발자
0. 본 포스팅은properties 를 영역별로 나누어 Config Server 로부터 받는 properties 를 Bean 에 바인딩하는 방법과,Application 이 자신의 properties는 물론, 바라보는 Config Server 의 properties 도 포함하여갱신하는 방법을 안내합니다. 1. properties 계층화1) property key 변경아래와 같이 원래 greeting 이었던 property key 를 devguide.greeting 으로 바꿔줍니다. 2) properties 를 Binding 할 Bean 생성평범한 Bean 하나를 만들어 @ConfigurationProperties 어노테이션을 추가하고, prefix 로 devguide 를 지정합니다.이로써 DevguideC..
0.본 포스팅은1~3장에 걸쳐 Cloud Config 에 대한 대략적인 설명과 Config Server 에 대한 간략한 가이드가 마무리 되었고,이번 포스팅 부터는 실제 Application 이 어떻게 Config Server 로 부터 properties 를 가져오는지 안내합니다.Config Client 는 두번으로 나눠서 포스팅할 계획인데요,그 첫번째로, Cloud Config 를 사용하는 Application 생성과 Config Server 로부터 properties 값 가져오기를 시작합니다. 1. Cloud Config 를 사용하는 Web Application 생성1) Application 생성제1장에서 계획한 프로젝트 구성에 따라서 New > Other > Spring > Spring Starter..
0. 본 포스팅은Config Server 가 Active 된 Profiles 에 맞는 Properties 를 제공할 수 있도록 Profiles 별로 어떻게 Properties 를 작성하면 되는지 가이드합니다. 1. Git 에 저장된 config 수정하기이전에 작성했던 환경설정 파일에는 profiles 를 고려하지 않고 단순히 작성되었습니다. 이걸 아래와 같이 profiles 별로 다른 값을 가지도록 수정합니다.느낌이 오실꺼라 믿습니다. 제가 account-service.properties가 아닌 account-service.yml 을 사용했다고 했는데요, 그 이유 중에 한가지가 바로 여기에 있습니다.properties 를 사용하면 profiles 별로 account-service-stage.propert..