78.9. 将 Camel 集成到 CXF 传输层


将 Camel 场合成您的 CXF 总线,您需要使用 CamelTransportFactory。您可以在 Java 中和 Spring 中执行此操作。

78.9.1. 在 Spring 中设置 Camel 传输

如果要配置任何特殊内容,您可以使用应用程序上下文中的以下代码片段:如果您只想激活 camel 传输,则不必在应用程序上下文中做任何操作。旦在您的应用程序中包含 camel-cxf-transport jar (or camel-cxf.jar),如果您的 camel 版本小于 2.7.x,则 cxf 将扫描 jar 并加载 CamelTransportFactory。

<!-- you don't need to specify the CamelTransportFactory configuration as it is auto load by CXF bus -->
<bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory">
  <property name="bus" ref="cxf" />
  <property name="camelContext" ref="camelContext" />
  <!-- checkException new added in Camel 2.1 and Camel 1.6.2 -->
  <!-- If checkException is true , CamelDestination will check the outMessage's
     exception and set it into camel exchange. You can also override this value
     in CamelDestination's configuration. The default value is false.
     This option should be set true when you want to leverage the camel's error
     handler to deal with fault message -->
  <property name="checkException" value="true" />
  <property name="transportIds">
    <list>
      <value>http://cxf.apache.org/transports/camel</value>
    </list>
  </property>
</bean>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat