0

I have a spring integration (4.1.6) app running on Wildfly 9.0.1 with AcitveMQ 5.13. I'm only using about 11 queues.

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.

My current Spring Integration configuration looks like this:

<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. Sometimes, just bouncing Wildfly will trigger message consumption. And sometimes, if I just let it sit, the message will get consumed. The messages are simple 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?

1 Answers1

1

The most common cause is a hung poller thread (stuck in user code). i.e. something downstream of gnfChannelIn is hanging the thread.

Use jstack or jvisualvm/jconsole to get a thread dump to see what the thread(s) are doing.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179