我有一个spring集成配置文件,类似于:
<int-jms:inbound-channel-adapter
channel="fromjmsRecon"
jms-template="jmsTemplate"
destination-name="com.mycompany.inbound.recon">
<int:poller fixed-delay="3000" max-messages-per-poll="1"/>
</int-jms:inbound-channel-adapter>
<int:publish-subscribe-channel id="fromjmsRecon"/>
<int:service-activator input-channel="fromjmsRecon"
ref="processInboundReconFile"
method="execute"/>
... 10 More inbound channels ...
<int-jms:inbound-channel-adapter
channel="fromjmsVanRecon"
jms-template="jmsTemplate"
destination-name="com.mycompany.inbound.another">
<int:poller fixed-delay="3000" max-messages-per-poll="1"/>
</int-jms:inbound-channel-adapter>
<int:publish-subscribe-channel id="fromjmsVanRecon"/>
<int:service-activator input-channel="fromjmsVanRecon"
ref="processInboundAnother"
method="execute"/>
</beans>有11个入站通道适配器。前10个连接到ActiveMQ,但第11个从来不连接。这些适配器列出的顺序并不重要,第11个适配器总是被忽略。服务适配器已初始化,但通道适配器从未连接到ActiveMQ。
入站通道适配器的数量是否有限制?我是否可以在某个地方设置一个属性来更改此限制?
谢谢你的帮助。
发布于 2016-07-22 01:15:00
正确,有一个名为TaskScheduler线程池的限制,大小为10。
http://docs.spring.io/spring-integration/reference/html/configuration.html#namespace-taskscheduler
因此,考虑使用spring.integration.taskScheduler.poolSize属性更改其大小,使用TaskExecutor对这些适配器使用TaskExecutor将任务转移到其他线程,并且不要吃昂贵的TaskScheduler。
还有其他方法:不要使用<int-jms:inbound-channel-adapter>,而是切换到<int-jms:message-driven-channel-adapter>,这是自然监听,而且更好。
https://stackoverflow.com/questions/38516234
复制相似问题