带有Jms连接器的Mule流,动态出站端点中的线程阻塞
我有一个jms连接器,我从队列接收消息,在流中处理消息,调用db根据消息中的某些ID获取数据,并将响应输出写入文件,我使用动态出站端点来确定输出位置带有Jms连接器的Mule流,动态出站端点中的线程阻塞,mule,Mule,我有一个jms连接器,我从队列接收消息,在流中处理消息,调用db根据消息中的某些ID获取数据,并将响应输出写入文件,我使用动态出站端点来确定输出位置 <jms:connector name="tibco" numberOfConsumers="20" ..... > ..... </jms:connector> <flow name="realtime" doc:name="ServiceId-8">
<jms:connector name="tibco" numberOfConsumers="20" ..... >
.....
</jms:connector>
<flow name="realtime" doc:name="ServiceId-8">
<jms:inbound-endpoint queue="${some.queue}" connector-ref="tibco" doc:name="JMS">
<jms:transaction action="ALWAYS_BEGIN"/>
</jms:inbound-endpoint>
<processor ref="proc1"></processor>
<processor ref="proc2"></processor>
<component doc:name="Java">
<spring-object bean="comp1"/>
</component>
<processor ref="proc3"></processor>
<collection-splitter doc:name="Collection Splitter"/>
<processor ref="endpointprocessor"></processor>
<foreach collection="#[message.payload.consumerEndpoints]" counterVariableName="endpoints" doc:name="Foreach">
<when expression="#[consumerEndpoint.getOutputType().equals('txt') and consumerEndpoint.getChannel().equals('file')]">
<processor-chain>
<file:outbound-endpoint path="#[consumerEndpoint.getPath()]" outputPattern="#[consumerEndpoint.getClientId()]-#[attributes['eventId']]%#[consumerEndpoint.getTicSeedCount()]-#[attributes['dateTime']].tic" responseTimeout="10000" doc:name="File"/>
</processor-chain>
</when>
<when expression="#[consumerEndpoint.getOutputType().equals('txt') and consumerEndpoint.getChannel().equals('ftp')]">
<processor-chain>
<ftp:outbound-endpoint path="#[consumerEndpoint.getPath()]" outputPattern="#[consumerEndpoint.getClientId()]-#[attributes['eventId']]%#[consumerEndpoint.getTicSeedCount()]-#[attributes['dateTime']].tic" host="#[consumerEndpoint.getHost()]" port="#[consumerEndpoint.getPort()]" user="#[consumerEndpoint.getChannelUser()]" password="#[consumerEndpoint.getChannelPass()]" responseTimeout="10000" doc:name="FTP"/>
</processor-chain>
</when>
</choice>
</foreach>
<rollback-exception-strategy doc:name="Rollback Exception Strategy">
<processor ref="catchExceptionCustomHandling"></processor>
</rollback-exception-strategy>
</flow>
.....
以上是不完整的流程。我粘贴了重要的部分来理解
问题1。由于我没有在任何级别定义任何线程策略,并且连接器具有numberOfConsumers=“20”,若我在队列中放入20条消息,将启动多少线程。
jms队列中的预取大小设置为20
问题2:我是否需要在接收端和/或流级别配置线程策略
当负载非常高时(假设一分钟内队列中有15k MSG),我看到消息处理速度变慢,线程转储显示如下情况:
“TIBCO EMS会话调度器(7905958)”prio=10 tid=0x00002AADD4CF000 nid=0x3714等待监视器条目[0x000000004af1e000]
java.lang.Thread.State:阻塞(在对象监视器上)
位于org.mule.endpoint.DynamicOutboundEndpoint.createStaticEndpoint(DynamicOutboundEndpoint.java:153)
-等待锁定(org.mule.endpoint.DynamicOutboundEndpoint)
任何帮助和指点都将不胜感激
谢谢-由于动态端点,消息处理变得很慢,我在创建和使用动态出站端点时看到线程拥塞。我使用的是mule 3.3.x,在查看了mule 3.4.x代码后,我意识到动态出站端点创建的处理更为恰当。升级到3.4,问题几乎消失了