【问题标题】:Azure service bus javax.jms.IllegalStateException: The MessageProducer was closed due to an unrecoverable errorAzure 服务总线 javax.jms.IllegalStateException:由于不可恢复的错误,MessageProducer 已关闭
【发布时间】:2020-11-19 18:36:30
【问题描述】:

我将 ASB 用于组件之间的入队/出队消息。组件 A 从队列 A 消费消息并从队列 B 产生消息。它消费然后在消费时产生。两个队列都使用具有不同队列名称(A 和 B)的同一 Azure 服务总线。

我的问题是,一旦组件空闲超过 10~15 分钟,然后尝试消费/生产,它就会抛出

javax.jms.IllegalStateException: The MessageProducer was closed due to an unrecoverable error.

和

Caused by: javax.jms.JMSException: The link 'G5S1:40611071:qpid-jms:sender:ID:bbc3fc62-4377-4aeb-bb80-117d74e780de:1:47:1:queueB' is force detached. Code: publisher(link578). Details: AmqpMessagePublisher.IdleTimerExpired: Idle timeout: 00:10:00. [condition = amqp:link:detach-forced]

观察堆栈跟踪和行为后,它在尝试向 queueB 生成消息时遇到问题。对于消费者和生产者,我在 MessageGateway bean 中使用同名 bean cachingConnectionFactory()(不确定是否重要)。

我的猜测是,当它消费时,它会重新启动与 queueA 的连接,而当它尝试重新启动与 queueB 的连接时,会出现问题。

有人知道吗?如果需要更多信息,请告诉我。

【问题讨论】:

  • 你最后有解决办法吗?

标签: amqp servicebus azure-servicebus-queues


【解决方案1】:

您是否尝试禁用缓存生成器?类似于:

 CachingConnectionFactory connectionFactory = (CachingConnectionFactory) jmsTemplte.getConnectionFactory();
    
    connectionFactory.setCacheProducers(false);

【讨论】:

  • 我有一个类似的问题 - 你知道为什么禁用它们会起作用吗?
猜你喜欢
  • 2016-02-19
  • 1970-01-01
  • 2013-04-27
  • 1970-01-01
  • 2020-07-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-14
相关资源
最近更新 更多