325.14. 使用现有端点映射的替代配置


对于带有 mapping-type beanname 的每个端点,Registry/ApplicationContext 中需要一个类型为 CamelEndpointDispatcher 的 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