4.6. 사용자 정의 Camel 컨텍스트 구성
Camel 자동 구성으로 생성한 CamelContext 8080에서 작업을 수행하려면 다음과 같이 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 컨텍스트에 추가할 수 있으며 모든 인스턴스가 실행됩니다.