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