简体   繁体   English

Spring Integration应用未使用ActiveMQ队列

[英]ActiveMQ queue not consumed from Spring Integration app

I have a spring integration (4.1.6) app running on Wildfly 9.0.1 with AcitveMQ 5.13. 我有一个使用AcitveMQ 5.13在Wildfly 9.0.1上运行的spring集成(4.1.6)应用程序。 I'm only using about 11 queues. 我只使用大约11个队列。

I have one queue that is getting stuck and the messages aren't consumed (Mostly). 我有一个陷入困境的队列,消息没有被使用(大部分)。 Every other queue I have gets consumed fine right on schedule with the poller on the inbound-channel-adapter. 我每隔一个队列就可以按计划与inbound-channel-adapter上的轮询器配合使用。

My current Spring Integration configuration looks like this: 我当前的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> 

One of the interesting things is that when I bounce everything (ActiveMQ and Wildfly) that will cause the messages in the queue to get consumed, most of the time. 有趣的事情之一是,当我反弹所有会导致队列中的消息被消耗的大部分时间(ActiveMQ和Wildfly)时,大多数时候。 Sometimes, just bouncing Wildfly will trigger message consumption. 有时,仅将Wildfly弹起将触发消息使用。 And sometimes, if I just let it sit, the message will get consumed. 有时,如果我静静地坐着,消息就会被消耗掉。 The messages are simple XML. 消息是简单的XML。

The other queues that I am using are all configured in the same fashion. 我正在使用的其他队列都以相同的方式配置。

Can anyone see anything amiss or has anyone run into and solved anything similar? 谁能看到任何不妥之处,或者有人遇到并解决了类似的问题?

The most common cause is a hung poller thread (stuck in user code). 最常见的原因是轮询程序线程挂起(卡在用户代码中)。 ie something downstream of gnfChannelIn is hanging the thread. gnfChannelIn下游挂了线程。

Use jstack or jvisualvm/jconsole to get a thread dump to see what the thread(s) are doing. 使用jstack或jvisualvm / jconsole获取线程转储以查看线程在做什么。

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

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