2016-01-22 46 views
0

我有一個運行在Wildfly 9.0.1上的AcitveMQ 5.13的spring集成(4.1.6)應用程序。我只用了大約11個隊列。ActiveMQ隊列不從Spring集成應用程序消耗

我有一個隊列卡住了,消息沒有被消耗(大部分)。我的其他每個隊列都按照計劃與入站通道適配器上的輪詢器一起正常使用。

我現在的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),將在隊列導致消息被消耗,大多數的時間。有時候,只是反彈蜻蜓會觸發消息消費。有時,如果我讓它坐下來,消息就會消耗殆盡。這些消息是簡單的XML。

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

任何人都可以看到任何錯誤或有任何人遇到並解決了類似的東西嗎?

回答

1

最常見的原因是掛起輪詢器線程(卡在用戶代碼中)。即gnfChannelIn下游的東西掛在線程上。

使用jstack或jvisualvm/jconsole獲取線程轉儲以查看線程正在做什麼。

相關問題