首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >什么是最大的Spring入站通道适配器?

什么是最大的Spring入站通道适配器?
EN

Stack Overflow用户
提问于 2016-07-22 00:06:58
回答 1查看 575关注 0票数 1

我有一个spring集成配置文件,类似于:

代码语言:javascript
复制
<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。

入站通道适配器的数量是否有限制?我是否可以在某个地方设置一个属性来更改此限制?

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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>,这是自然监听,而且更好。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38516234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档