【问题标题】:link spring integration channel to hornetq将 spring 集成通道链接到 hornetq
【发布时间】:2015-06-03 01:42:26
【问题描述】:

这似乎很简单,但我无法解决。

我使用的是 spring-boot 1.2.2。我在application.properties 中有一个大黄蜂队列设置:

spring.hornetq.mode=embedded
spring.hornetq.embedded.enabled=true
spring.hornetq.embedded.queues=myQueue

我已经导入了integration-context.xml 文件。

@ImportResource("integration-context.xml")

并定义了以下激活器:

<int:service-activator 
    input-channel="myQueue"
    ref="myEndpointImpl"
    method="send" > 
</int:service-activator>

但是当我在 myQueue 上放一条消息时,send 方法不会被触发。

我做错了什么?

【问题讨论】:

    标签: spring-boot spring-integration hornetq


    【解决方案1】:

    HornetQ 是 JMS 代理,拥有该配置,您只需提供一个带有 myQueue 定义的嵌入式模式,该定义由 Boot 在应用程序启动时创建。在 Spring Boot Manual 中查看更多信息。

    Spring Integration 允许通过适当的adapters 使用 JMS。

    因此,如果您打算使用 Spring Integration 收听 HornetQ myQueue 并执行一些进一步的集成流程,您确实应该为该队列配置 &lt;int-jms:message-driven-channel-adapter&gt;,然后继续使用您的 &lt;service-activator&gt; 等。

    欢迎提出更多问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-03
      • 1970-01-01
      • 2017-07-27
      • 1970-01-01
      • 2012-10-29
      • 2011-02-15
      • 1970-01-01
      相关资源
      最近更新 更多