4.3. 自動設定された Camel コンテキスト
Camel auto configuration は CamelContext
インスタンスを提供し、SpringCamelContext
を作成します。また、コンテキストの初期化およびシャットダウンを実行します。この Camel コンテキストは、camelContext
Bean 名で Spring アプリケーションコンテキストに登録され、他の Spring Bean と同様にアクセスできます。
たとえば、以下に示すように camelContext
にアクセスできます。
@Configuration public class MyAppConfig { @Autowired CamelContext camelContext; @Bean MyService myService() { return new DefaultMyService(camelContext); } }