为什么redeliveryPlugin不向DLQ发送消息?

时间:2019-10-02 00:31:14

标签: configuration activemq apache-servicemix

如果超出该数量,我尝试自动将消息发送到DLQ,然后重试。为此,我使用redeliveryPlugin。
我有一个ActiveMQ(broker.xml)的配置

<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core.xsd">
<broker xmlns="http://activemq.apache.org/schema/core"
        brokerName="${broker-name}"
        dataDirectory="${data}"
        schedulerSupport="true"
        start="false" restartAllowed="false"
        >
    <destinationPolicy>
        <policyMap>
          <policyEntries>
            <policyEntry queue=">">
                <deadLetterStrategy>
                    <individualDeadLetterStrategy processExpired="false" queuePrefix="DLQ." useQueueForQueueMessages="true"/>
                </deadLetterStrategy>
            </policyEntry>
          </policyEntries>
        </policyMap>
    </destinationPolicy>
    <managementContext>
        <managementContext createConnector="false"/>
    </managementContext>
    <persistenceAdapter>
        <kahaDB directory="${data}/kahadb"/>
    </persistenceAdapter>
    <plugins>
        <jaasAuthenticationPlugin configuration="karaf" />
        <redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
            <redeliveryPolicyMap>
                <redeliveryPolicyMap>
                    <redeliveryPolicyEntries>
                        <redeliveryPolicy 
                            queue=">"
                            useExponentialBackOff="true"
                                          backOffMultiplier="2"
                                          initialRedeliveryDelay="1000"
                                          maximumRedeliveryDelay="60000"
                                          maximumRedeliveries="-1"/>
                    </redeliveryPolicyEntries>
                    <defaultEntry>
                        <redeliveryPolicy maximumRedeliveries="6"
                                          initialRedeliveryDelay="1000"
                                          redeliveryDelay="5000"/>
                    </defaultEntry>
                </redeliveryPolicyMap>
            </redeliveryPolicyMap>
        </redeliveryPlugin>
    </plugins>
    <systemUsage>
        //
    </systemUsage>
    <transportConnectors>
        <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        <transportConnector name="amqp" uri="amqp://0.0.0.0:5672"/> 
    </transportConnectors>
</broker>

在此图片参数中,JMSXDeliveryCount的值为3,我希望插件将消息发送到DLQ,但这没有发生,我也不明白为什么

enter image description here

UPD:

我在配置schedulerSupport =“ true”中添加了内容,但是在ActiveMQ控制台中,已安排的列表为空

enter image description here

0 个答案:

没有答案