7.8. 사용자 정의 Camel 컨텍스트 구성
Camel Spring Boot 자동 구성으로 생성된 CamelContext kubeconfig에서 작업을 수행하려면 Spring 컨텍스트에 CamelContextConfiguration 인스턴스를 등록합니다.
절차
아래와 같이 Spring 컨텍스트에서
CamelContextConfiguration인스턴스를 등록합니다.@Configuration public class MyAppConfig { ... @Bean CamelContextConfiguration contextConfiguration() { return new CamelContextConfiguration() { @Override void beforeApplicationStart(CamelContext context) { // your custom configuration goes here } }; } }
CamelContextConfiguration 및 beforeApplicationStart(CamelContext) 방법은 Spring 컨텍스트가 시작되기 전에 호출되므로 이 콜백에 전달되는 CamelContext 인스턴스는 완전히 자동 구성됩니다. CamelContextConfiguration 의 여러 인스턴스를 Spring 컨텍스트에 추가할 수 있으며, 모두 실행됩니다.