首页 文章

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

提问于
浏览
1

我有一个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个连接到ActiveMQ . 列出这些适配器的顺序无关紧要,第11个始终被忽略 . 服务适配器已初始化,但通道适配器从未连接到ActiveMQ .

入站通道适配器的数量是否有限制?有没有我可以在某处更改此限制的属性?

谢谢你的帮助 .

1 回答

  • 2

    正确,有一个名为 TaskScheduler 线程池的限制,大小为 10

    http://docs.spring.io/spring-integration/reference/html/configuration.html#namespace-taskscheduler

    因此,考虑使用 spring.integration.taskScheduler.poolSize 属性更改其大小,使用 TaskExecutor 用于那些适配器将任务转移到其他线程并且不要吃昂贵的 TaskScheduler .

    还有其他方法:不要使用 <int-jms:inbound-channel-adapter> ,但切换到 <int-jms:message-driven-channel-adapter> ,这听起来更好 .

相关问题