325.14. 备用配置,使用现有端点映射


对于带有 mapping-type beanname 一个类型为 CamelEndpointDispatcher 的端点,Registry/ApplicationContext 中需要带有对应名称的 bean。此 bean 充当 Camel 端点和现有 端点映射 之间的桥接,如 PayloadRootQNameEndpointMapping

注意:使用 beanname mapping-type 主要用于(传统)的情况,您已使用 Spring-WS,并在 Spring XML 文件中定义端点映射。beanname mapping-type 允许您将 Camel 路由放入现有的端点映射中。从头开始时,建议将端点映射定义为 Camel URI (如在 endpointMapping上方所示),因为它需要较少的配置且更加表达。另外,您还可以在注解中使用 vanilla Spring-WS。

使用 beanname 的路由示例:

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="spring-ws:beanname:QuoteEndpointDispatcher" />
        <to uri="mock:example" />
    </route>
</camelContext>

<bean id="legacyEndpointMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    <property name="mappings">
        <props>
            <prop key="{http://example.com/}GetFuture">FutureEndpointDispatcher</prop>
            <prop key="{http://example.com/}GetQuote">QuoteEndpointDispatcher</prop>
        </props>
    </property>
</bean>

<bean id="QuoteEndpointDispatcher" class="org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher" />
<bean id="FutureEndpointDispatcher" class="org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher" />
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat