activemq 代理重新交付插件配置不适用于主题

问题描述:

我在 conf/activemq.xml 文件中有以下配置

I have the following configuration in by conf/activemq.xml file

    <plugins>
        <redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
            <redeliveryPolicyMap>
                <redeliveryPolicyMap>
                    <defaultEntry>
                        <redeliveryPolicy maximumRedeliveries="20" useExponentialBackOff="true" initialRedeliveryDelay="60000" redeliveryDelay="60000" maximumRedeliveryDelay="600000"/>
                    </defaultEntry>
                </redeliveryPolicyMap>
            </redeliveryPolicyMap>
        </redeliveryPlugin>
    </plugins>

我正在使用带有 Spring/JMS/Camel/JTA (Atomikos) 的 activemq-5.11.

I am using activemq-5.11 with Spring/JMS/Camel/JTA (Atomikos).

因为我使用的是 JTA/XA 事务,activeMQ 连接工厂的重新传递策略不适用于主题.所以我试图在服务器上设置重新投递策略.

Because, I am using JTA/XA transactions, the redelivery policy at the activeMQ connection factory is not working for topics. So I am trying to set the redelivery Policy on the server.

然而,它似乎不断地重新发送主题消息.

However, it seems to be continuously resending the topic message.

附注.我只有一个订阅者(持久).

PS. I have only one subscriber (durable).

我解决了这个问题.就我而言,问题是我也在客户端使用了重新交付策略.不知何故,这把事情搞砸了.

I was able to resolve the issue. In my case, the issue was that I was using the redelivery policy at the client side also. And somehow, that was messing it up.

因为我使用的是 JTA,所以我不想在客户端重新绑定,并希望从 ActiveMQ 代理服务器中退出消息.一旦我从 Camel 配置中删除了所有错误处理和重新传递策略,它就可以正常工作.

Since I am using JTA, I wanted no retying at the client side and wanted the message to be retired from the ActiveMQ broker server. And Once I removed all error handling and redelivery policy from the Camel configuration, it worked like as it should.

希望这对未来的人有所帮助.

Hope this helps someone in the future.