搜索

7.5. 关于 Spring Boot 的 Camel 上下文自动配置

download PDF

Camel Spring Boot 自动配置提供 CamelContext 实例,并创建一个 SpringCamelContext。它还初始化并执行该上下文的关机。此 Camel 上下文在 camelContext bean 名称下的 Spring 应用程序上下文中注册,您可以像其他 Spring bean 一样访问它。您可以访问 camelContext,如下所示。

Example

@Configuration
public class MyAppConfig {

  @Autowired
  CamelContext camelContext;

  @Bean
  MyService myService() {
    return new DefaultMyService(camelContext);
  }

}

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.