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

ActiveMQ Artemis联邦:下游Broker接收消息JMSXDeliveryCount为null的问询

ActiveMQ Artemis联邦场景下JMSXDeliveryCount属性问题解决

针对下游broker转发消息时JMSXDeliveryCount属性为null,导致Qpid Proton C++客户端抛出异常的问题,有两种配置方案可选:

方案1:自动设置JMSXDeliveryCount初始值

在address-policy节点添加set-delivery-count="true"配置,下游broker会为转发的消息自动初始化该属性值为1(对应首次投递到下游broker的场景),符合JMS规范要求。修改后的完整配置如下:

<federations>
   <federation name="federation" >
      <upstream name="fedUpBroker" user="***" password="***">
         <static-connectors>
              <connector-ref>connCore</connector-ref>
         </static-connectors>
         <policy ref="fedUpBrokerPolicy"/>
      </upstream>

      <address-policy name="fedUpBrokerPolicy" max-hops="1" auto-delete="true" auto-delete-delay="300000" auto-delete-message-count="-1" set-delivery-count="true">
         <include address-match="#" />
      </address-policy>
   </federation>
</federations>

方案2:移除JMSXDeliveryCount属性

若客户端不依赖该属性,可直接在upstream节点中配置移除这个属性,避免null值引发异常。修改后的配置如下:

<federations>
   <federation name="federation" >
      <upstream name="fedUpBroker" user="***" password="***">
         <static-connectors>
              <connector-ref>connCore</connector-ref>
         </static-connectors>
         <policy ref="fedUpBrokerPolicy"/>
         <remove-properties>
             <property name="JMSXDeliveryCount"/>
         </remove-properties>
      </upstream>

      <address-policy name="fedUpBrokerPolicy" max-hops="1" auto-delete="true" auto-delete-delay="300000" auto-delete-message-count="-1">
         <include address-match="#" />
      </address-policy>
   </federation>
</federations>

方案选择建议

  • 若客户端逻辑需要依赖JMSXDeliveryCount属性的存在,优先选择方案1,保证属性值符合规范;
  • 若客户端无需该属性,选择方案2直接移除即可解决异常问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.13 00:42:21