繁体   English   中英

使用 spring 集成从 activemq 队列消费消息

[英]consuming message from activemq queue using spring integration

所以我有应用程序将消息发送到带有 spring 集成的 activemq 队列。

 <int-feed:inbound-channel-adapter id="feedAdapter"
                                      channel="feedChannel"
                                      auto-startup="${auto.startup:true}"
                                      url="https://stackoverflow.com/feeds/question/49479712">
        <int:poller fixed-rate="10000"/>
    </int-feed:inbound-channel-adapter>

    <int:channel id="feedChannel"/>

    <int:transformer id="transformer" input-channel="feedChannel"
                     expression="payload.title + payload.author + '#{systemProperties['line.separator']}'"
                     output-channel="feedOutputChannel"/>

    <int:channel id="feedOutputChannel"/>

    <jms:outbound-gateway id="jmsOutGateway"
                          request-destination="inputQueue"
                          request-channel="feedOutputChannel"
                          requires-reply="false"/>

但是现在我想创建不同的应用程序,它使用来自该队列的消息,并通过 spring 集成将其打印到控制台。 我做了这个:

  <jms:message-driven-channel-adapter id="JMSInboundAdapter" destination="inputQueue"/>

    <bean id="inputQueue" class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg value="input.queue"/>
    </bean>

当我运行将消息发送到队列的应用程序时,它可以工作。 但是当我运行消息消耗应用程序时它不会。 我得到的错误: Dispatcher has no subscribers for channel 'application.JMSInboundAdapter'.

我需要如何配置我的消息消费者应用程序?

如果适配器上没有channel ,则id成为通道名称。

您需要订阅该频道的内容(例如<service-activator inputChannel="JMSInboundAdapter"... /> )。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM