6.5. 关于 Spring Boot 的 Camel 上下文自动配置
Camel Spring Boot auto-configuration 提供 CamelContext
实例,并创建一个 SpringCamelContext
。它还初始化并执行该上下文的关机。此 Camel 上下文在 Spring 应用程序上下文中注册,其名称为 camelContext
an,您可以像其他 Springan 那样访问它。您可以访问以下所示的 camelContext
。
示例
@Configuration public class MyAppConfig { @Autowired CamelContext camelContext; @Bean MyService myService() { return new DefaultMyService(camelContext); } }