【问题标题】:Camel and Spring IntegrationCamel 和 Spring 集成
【发布时间】:2015-10-29 22:52:35
【问题描述】:

我想从 apache camel 站点测试骆驼弹簧集成示例 http://camel.apache.org/springintegration.html 但我遇到了异常 org.apache.camel.RuntimeCamelException: org.springframework.integration.MessageDeliveryException: Dispatcher 没有频道 outputchannel 的订阅者。

我的短代码如下:

<channel id="inChannel"/>
<channel id="outputChannel"/>

<beans:bean id="greeting" class="com.javarticles.spring.integration.Greeting"/>

<service-activator input-channel="inChannel" ref="greeting"   method="sayHello" output-channel="outputChannel"/>

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="activemq:activemqsource"/>
        <to uri="log:input"/>
        <to uri="spring-integration:inChannel? inputChannel=outputChannel"/>
        <to uri="log:output"/>
    </route>


我试图搜索相关问题,但我没有得到骆驼任何人可以告诉我如何订阅输出频道

【问题讨论】:

    标签: apache-camel spring-integration


    【解决方案1】:

    根据你提到的骆驼文档,配置应该是这样的:

     <to uri="spring-integration:inputChannel?inOut=true&amp;inputChannel=outputChannel"/>
    

    你的问题是inOut=true:

    Spring 集成端点应该使用的交换模式。如果 inOut=true 则需要回复通道,来自 Spring Integration Message 标头或在端点上配置。

    【讨论】:

    • @Bilan 感谢您的回复。但据我了解,spring-integration 消费者端点中的选项 inputChannel=outputChannel 用于接收来自服务激活器的回复。如果这不正确,我该如何定义回复通道。你能给我举个例子吗
    • ???我不明白你不明白什么。我只是向您展示 Camel 教程提供的内容。根据他们的话,您应该使用inputChannel=outputChannel 来期待service-activator 的回复。你真的需要inOut=true,因为我对骆驼一无所知,除非教程中的那些话。
    • 这是同样的错误。
    猜你喜欢
    • 2013-01-06
    • 1970-01-01
    • 2017-06-24
    • 2016-10-26
    • 2018-08-24
    • 2020-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多