You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Integration向JMS Topic发送首条消息耗时过长问题排查

JMS消息发送首条耗时过长问题

我使用Spring Integration向Red Hat AMQ 7.8.2的JMS Topic生产消息时发现:应用启动或重启后,发送首条消息耗时3-4秒,但后续消息仅需40-50毫秒即可完成。推测该耗时差异源于连接工厂创建及与Broker建立连接的过程。

相关配置代码

<si-jms:outbound-channel-adapter id="communication"
   connection-factory="connectionFactoryCached"
   channel="communicationChannel"
   destination-name="${communications.topic}"
   pub-sub-domain="true" />

<bean id="connectionFactory"
   class="javax.jms.ConnectionFactory"
   factory-bean="simpleAmqConnectionFactory"
   factory-method="createConnectionFactory" />
    
<bean id="connectionFactoryCached"
   class="org.springframework.jms.connection.CachingConnectionFactory"
   p:targetConnectionFactory-ref="connectionFactory"
   p:sessionCacheSize="3" />

内容的提问来源于stack exchange,提问作者Sharath gowda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 09:35:24