【问题标题】:ActiveMQ queue not consumed from Spring Integration appSpring Integration 应用程序未使用 ActiveMQ 队列
【发布时间】:2016-04-29 13:37:04
【问题描述】:

我有一个 spring 集成 (4.1.6) 应用程序在 Wildfly 9.0.1 和 AcitveMQ 5.13 上运行。我只使用了大约 11 个队列。

我有一个队列卡住了,消息没有被消耗(大部分)。在入站通道适配器上的轮询器中,我使用的每个其他队列都可以按计划正常使用。

我当前的 Spring Integration 配置如下所示:

<beans:bean id="gnfReportConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
    <beans:property name="targetConnectionFactory">
        <beans:bean class="org.apache.activemq.ActiveMQConnectionFactory" >
            <beans:property name="brokerURL" value="${activemq.broker.url}" />
            <beans:property name="checkForDuplicates" value="false" />
        </beans:bean>
    </beans:property>
    <beans:property name="sessionCacheSize" value="100" />
    <beans:property name="cacheProducers" value="true" />
    <beans:property name="cacheConsumers" value="true" />
    <beans:property name="reconnectOnException" value="true" />
</beans:bean>

<!-- Email Router -->
<channel id="gnfChannelIn" />
<channel id="gnfChannelOut" />

<beans:bean id="gnfReportQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <beans:constructor-arg value="${gnf.report.queue}" name="name" />
</beans:bean>

<int-jms:inbound-channel-adapter id="gnfReportChannelAdapter" connection-factory="gnfReportConnectionFactory" destination="gnfReportQueue" channel="gnfChannelIn" auto-startup="true">
    <poller fixed-delay="60" time-unit="SECONDS" max-messages-per-poll="-1" receive-timeout="10000" />
</int-jms:inbound-channel-adapter> 

其中一件有趣的事情是,当我反弹所有会导致队列中的消息被消耗的东西(ActiveMQ 和 Wildfly)时,大部分时间。有时,只是弹跳 Wildfly 就会触发消息消费。有时,如果我让它坐下来,消息就会被消耗掉。消息是简单的 XML。

我使用的其他队列都以相同的方式配置。

任何人都可以看到有什么问题,或者有人遇到并解决了类似的问题吗?

【问题讨论】:

    标签: java activemq spring-integration wildfly-9


    【解决方案1】:

    最常见的原因是轮询线程挂起(卡在用户代码中)。即gnfChannelIn 下游的东西正在挂起线程。

    使用 jstack 或 jvisualvm/jconsole 获取线程转储以查看线程在做什么。

    【讨论】:

      猜你喜欢
      • 2013-01-17
      • 2018-08-03
      • 2014-07-28
      • 2020-11-10
      • 1970-01-01
      • 2021-11-11
      • 2023-02-12
      • 1970-01-01
      • 2014-10-30
      相关资源
      最近更新 更多