【问题标题】:Mule exception strategy骡子异常策略
【发布时间】:2020-09-17 10:15:44
【问题描述】:

仅在一个特定队列上,Mule JMS 消费者计数变为 0,并在某个时间点后恢复为默认数字

我的问题是,为什么它会下降到 0 并且我有消息卡在队列中?片刻之后,我发现它返回到 32(默认 numberOfConcurrentTransactedRecievers)并处理消息,然后再次返回到 0 个消费者。可能是什么问题?

我有其他消费者在同一个骡子中,它们能够干净地处理而不会减少计数。

我的配置:

<!-- ActiveMQ Connection factory -->
<spring:bean id="domainConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" lazy-init="true">
    <spring:property name="brokerURL" value="tcp://78.99.88.72:61616?jms.prefetchPolicy.all=2&amp;jms.useAsyncSend=true&amp;socketBufferSize=131072" />
    <spring:property name="redeliveryPolicy" ref="domainRedeliveryPolicy" />
</spring:bean>

<!-- amqExceptionConnectionFactory Connection factory -->
<spring:bean id="amqExceptionConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" lazy-init="true">
    <spring:property name="brokerURL" value="failover:(${domain.amq.failover.url}?jms.prefetchPolicy.all=2)" />
    <spring:property name="redeliveryPolicy" ref="domainRedeliveryPolicy" />
</spring:bean>
<jms:activemq-connector 
    name="com.KKT.jmsConnector" 
    username="${domain.amq.user.id}" 
    password="${domain.amq.user.password}" 
    connectionFactory-ref="pooledConnectionFactory"
    validateConnections="true" 
    numberOfConcurrentTransactedReceivers="32"
    acknowledgementMode="AUTO_ACKNOWLEDGE"  
    persistentDelivery="false" 
    doc:name="AMQ Connector for KKTInterface" 
    specification="1.1">
    <receiver-threading-profile maxThreadsActive="32" poolExhaustedAction="WAIT"/>
    <dispatcher-threading-profile maxThreadsActive="128" poolExhaustedAction="WAIT"/>
    <reconnect count="15" frequency="5000" blocking="true"/>
</jms:activemq-connector>

我看到以下错误:

mule.log.5:2020-05-29 20:24:49,392 [ERROR] KKT.router [ActiveMQ Session Task-6] | ed938f60-a1d8-11ea-8ad7-525400aef612: KKT Interface: Unrecoverable Error: Please check ASAP: org.mule.transport.jms.redelivery.MessageRedeliveredException: "Message with id "ID:localhost-35511-1590775568949-1:1:162:1:3367" has been redelivered 1 times on endpoint "jms://com.KKT.router.inbox", which exceeds the maxRedelivery setting of 0 on the connector "com.KKT.router.jmsConnector".
mule.log.5:2020-05-29 20:24:49,216 [ERROR] exception.CatchMessagingExceptionStrategy [ActiveMQ Session Task-5] |
mule.log.5:2020-05-29 20:24:49,216 [ERROR] exception.CatchMessagingExceptionStrategy [ActiveMQ Session Task-4] |
mule.log.9:2020-05-29 20:24:32,753 [ERROR] exception.CatchMessagingExceptionStrategy [ActiveMQ Session Task-57] |
mule.log.9:2020-05-29 20:24:32,753 [ERROR] KKT.router [ActiveMQ Session Task-57] | db927d80-a1d8-11ea-8ad7-525400aef612: KKT Interface: Unrecoverable Error: Please check ASAP: org.mule.api.service.FailedToQueueEventException: Interrupted while queueing event for "SEDA Stage com.KKT.router.requestGateway.stage1".

【问题讨论】:

  • 您是指重新投递计数吗?除了您的问题,请添加配置、Mule 版本、ActiveMQ 版本等。
  • @JustinBertram :我的问题是,为什么它会下降到 0 并且我有消息卡在队列中。在我停止负载测试的片刻之后,我发现它达到了 32(默认 numberOfConcurrentTransactedRecieverrs)并处理了消息。可能是什么问题呢。我有其他消费者在同一头骡子中,它们能够干净地处理而不会减少计数
  • 好吧,我错过了。一定会追的
  • @aled:我已经发布了详细信息
  • @JustinBertram:有什么技术建议吗?

标签: mule activemq mule-esb


【解决方案1】:

问题似乎是某些错误触发了消息的重新传递。当重新发送计数超过最大值时,您会收到重新发送错误。

您应该熟悉 JMS 连接器重新传递配置:https://docs.mulesoft.com/mule-runtime/3.9/jms-transport-reference。然后检查回滚异常策略https://docs.mulesoft.com/mule-runtime/3.9/rollback-exception-strategy,了解如何处理这些错误。

请注意,ActiveMQ 可能有自己的重新传递配置。

【讨论】:

  • 哦,好的。非常感谢 Aled。我会检查一下。我也有疑问。在我的 mule 中,我能够将我的应用程序调整为每秒 8 条消息,持续 20 分钟。但是当我达到每秒 10 条消息时。我发现在连续运行 5 分钟后开始构建一个很大的时间延迟吞吐量从 1 秒逐渐上升到 1 分钟。我在 AMQ 和其他方面使用 mule,我构建并运行了 spring 代码,这些代码消耗这些消息..处理它并将其作为编排模式的一部分放回队列。这种情况的原因可能是什么。内存看起来不错
  • 这是一个完全不同的问题。
猜你喜欢
  • 1970-01-01
  • 2016-03-18
  • 1970-01-01
  • 2014-01-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-10
  • 1970-01-01
相关资源
最近更新 更多