Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQ broker redelivery vs consumer redelivery

I'm trying to understand the difference between ActiveMQ redeliveryPlugin and consumer's attempt to recieve messages before it marks it as a poison pill. What's the difference. In the documentation there'is an example:

<broker xmlns="http://activemq.apache.org/schema/core"    schedulerSupport="true" >
        .... 
        <plugins>
            <redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
                <redeliveryPolicyMap>
                    <redeliveryPolicyMap>
                        <redeliveryPolicyEntries>
                            <!-- a destination specific policy -->
                            <redeliveryPolicy queue="SpecialQueue" maximumRedeliveries="4"
redeliveryDelay="10000" />
                        </redeliveryPolicyEntries>
                        <!-- the fallback policy for all other destinations -->
                        <defaultEntry>
                            <redeliveryPolicy maximumRedeliveries="4" initialRedeliveryDelay="5000"
redeliveryDelay="10000" />
                        </defaultEntry>
                    </redeliveryPolicyMap>
                </redeliveryPolicyMap>
            </redeliveryPlugin>
        </plugins>

Now, I uderstand the broker's redelivery system as a separate to the client's one. For instance, after making 6 attempts (by default) to acknowledge a message (CLIENT_ACKNOWLDGMENT mode) the consumer send a poison pill. So, is it true that after receiving the poison pill, broker will try to resend the message to the consumer which will make another 6 attempt.

So, in total we may have 4 x 6 = 24 attempts before the message will send to a DLQ.

Is my understading correct?

like image 730
St.Antario Avatar asked Sep 27 '22 04:09

St.Antario


1 Answers

Yes. The broker is not aware of any client redelivery. That happens in "the driver" - in memory. The broker won't consider if the client has already retried or not. The result is nested retries which is good to be aware of.

like image 151
Petter Nordlander Avatar answered Oct 06 '22 05:10

Petter Nordlander