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


对于带有映射类型 beanname 的每个端点,在 Registry/ApplicationContext 中需要带有相应名称的 CamelEndpointDispatcher 类型。这个 bean 充当 Camel 端点和现有 端点映射 (如 PayloadRootQNameEndpointMapping )之间的桥接。

注意:在您已使用 Spring-WS 且在 Spring XML 文件中定义的端点映射时,使用 beanname 映射类型主要用于(传统的)情况。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