MSA를 다루는 기술 중 하나인 Externalized Configuration 에 대해서 작성해볼 것이다.
영어 직독 그대로 해석을 하면
설정 파일을 외부로 빼는 것이다.
만약 MSA를 다루면서 여러 환경(local,dev,ait 등등) 에서 테스트를 거친다면 해당 MSA마다, 환경마다 configuration 파일을 각각 만들어서 build & deploy를 해야한다.
이런 불편함을 줄이고자 한번의 build로 여러 설정파일을 가지고 환경별로, MSA 별로 deploy 를 할수 있게 된다.
이전에 다룬 참고포스팅에서는 사용법에 대해서 다룬 글이 있다.
참고 바란다.
자바에서도 이 방식을 권장하고 공식 홈페이지에서는 아래와 같은 정리 사이트도 존재한다.
24. Externalized Configuration
Getters and setters are usually mandatory, since binding is through standard Java Beans property descriptors, just like in Spring MVC. A setter may be omitted in the following cases:Maps, as long as they are initialized, need a getter but not necessarily a
docs.spring.io
참고 포스팅
https://thenicesj.tistory.com/650
springboot 에서 profiles 설정
실무에서 개발을 하다보면 규모에 따라 다를수 있지만, 본인 피시는 local 를 포함하여 dev 환경 prd 환경 등 다양하게 설정이 다를수 있다. springboot 를 사용하게 될 경우 yml 파일로 설정정보를 셋팅
thenicesj.tistory.com
'IT > Java' 카테고리의 다른 글
Spring Boot [0.0.1-SNAPSHOT] is not compatible with this Spring Cloud release train (37) | 2024.04.15 |
---|---|
GitLab4J (22) | 2024.04.08 |
java.net.MalformedURLException (19) | 2024.04.06 |
java.lang.IllegalArgumentException at java.sql.Date.valueOf(Date.java:141) (17) | 2024.04.04 |
No value supplied for the SQL parameter 'column': No value registered for key 'column’ (22) | 2024.04.02 |
댓글