1. 소개
bluesky-boot는 spring-boot를 기반으로 multi module 프로젝트를 사용하기 위한 기능들을 추가하여 관리하는 프로젝트입니다.
이 모듈의 기능을 기반으로 bluesky-boot-autoconfigure가 제공되며 autoconfigure를 사용하지 않고 직접 구현하여 사용할 수 있습니다.
2. 상세 기능
2.1. spring multi profile 지원
스프링의 spring.profiles.active
설정을 복수로 사용하여도 blueksy-boot-autoconfigure
의 설정 파일 관리에 영향이 없도록 하기 위해 BlueskyEnvironmentPostProcessor
를 통해 지정된 profile을 사용하여 관리하도록 합니다.
2.2. multi module 지원
여기에서 module은 maven의 module이 아닙니다.
하나의 웹 또는 앱 서비스가 실행되면 해당 서비스에서 요청에 따라 분기 처리가 필요한 경우가 있습니다.
예를 들어 웹서버 하나에서 도메인 별로 여러 웹을 제공해 줄 수 있습니다.
이런 경우 여러 웹에 대해 각각의 웹에 대해 다른 설정을 관리해야 합니다.
bluesky-boot에서는 BlueskyProperties 를 제공합니다.
해당 interface의 내용은 다음과 같습니다.
public interface BlueskyProperties<T> {
Map<String, T> getModules();
}
Spring Boot에서 관리하는 ConfigurationProperties를 만드는 객체 interface이며 이 interface를 확장하여 modules map을 만들어 여러 개의 모듈을 관리할 수 있습니다.
또한 BlueskyProperties를 확장한 객체도 여러 개 만들 수 있습니다.
이 중 가장 핵심이 되는 기능을 제공하기 위해 BlueskyCoreProperties와 BlueskyCoreModuleProperties를 제공합니다.
bluesky-boot를 bluesky-boot-autoconfigure 없이 사용하고자 하는 경우 해당 interface의 구현이 필수입니다.
public interface BlueskyCoreProperties<T extends BlueskyCoreModuleProperties> extends BlueskyProperties<T> {
/**
* module 호출 처리 방식 정의 <br />
* [domain , addPathPattern, moduleNameResolver]
*/
CoreModulePropertiesResolveType getResolveType();
void setResolveType(CoreModulePropertiesResolveType resolveType);
}