-
환경 설정 값에 따라 기능 실행하기개발 2020. 6. 10. 17:23
active 값과는 별도로 properties안의 설정값에 따라 기능을 분리하겠다.
@ConditionalOnProperty
@Bean @ConditionalOnProperty(name="type", havingValue="B") public void test() { System.out.println("amazing"); }
properties에 정의된 key값이 type인 value가 B일 경우에만 test()를 실행시킨다.
이 외에도 다양한 @Conditional 종류가 있다.
'개발' 카테고리의 다른 글
React axios POST DataForm 전달하기 (insert) (0) 2020.06.17 @Scheduled - spring boot scheduling 설정 (0) 2020.06.11 swagger spring boot (0) 2020.06.08 AWS mariaDB 생성하기(feat. Freetier, 파라미터 그룹 생성) (0) 2020.06.07 Node Express JS 로 서버 만들기 (0) 2020.06.05