Repository navigation
ARTEMIS-6311 Preserve delivery count on redistribution - #6874
Conversation
|
This looks pretty good. However, there are a few issues that need to be resolved. However, rather than go back and forth here I just push a branch with everything I think is needed. Feel free to pull this in and squash it with your own commit. |
c82ebbb to
21db157
Compare
Thanks for the review and the changes @jbertram . I pulled your commit in and squashed it with mine. |
|
@jbertram Do you see any other issues with that PR? Or could we merge it and get it into a release soon? There are several fixes on main that would be useful once these issues are resolved. |
|
@leisma, I'm actually having some trouble getting a clean run through CI. Can you rebase to pick up a handful of recent fixes? |
The delivery count is tracked on the MessageReference, so a message that is redistributed to another broker of the cluster starts over at zero, causing max-delivery-attempts to be enforced per broker instead of cluster wide. The originating broker now carries the delivery count over on the redistributed copy via _AMQ_REDISTRIBUTION_DELIVERY_COUNT, which the target broker applies when it creates the MessageReference. The behavior is gated by the new address setting preserve-delivery-count-on-redistribution and is disabled by default Assisted-by: Justin Bertram Signed-off-by: Marc Leisi <137479805+leisma@users.noreply.github.com>
21db157 to
2563190
Compare
|
@leisma, that did it! Nice work, and thanks for the great contribution. |
The delivery count is tracked on the MessageReference, so a message that is redistributed to another broker of the cluster starts over at zero. This causes max-delivery-attempts to be enforced per broker instead of cluster wide.
The originating broker now carries the delivery count over on the redistributed copy via the _AMQ_REDISTRIBUTION_DELIVERY_COUNT property, which the target broker applies when it creates the MessageReference. The behavior is gated by the new address setting preserve-delivery-count-on-redistribution (default false).
The property is set between redistribute() and processRoute(): earlier it would be reset by clearInternalProperties(), later the MessageReference already exists. For the same reason it is not an internal property, so it stays visible to clients on the target broker, like _AMQ_INGRESS_TIMESTAMP.
The target broker only applies the count if the receiving queue has the setting enabled itself (internal queues such as store-and-forward are skipped), and only reads the property in that case, so a broker with the feature off pays nothing. Asymmetric configurations and rolling upgrades are therefore safe.
Supporting changes:
The setting defaults to false, so existing behaviour is unchanged. RedeliveryWithRedistributionClusterTest covers the baseline, the default reset, the preserved count, restart, asymmetric configuration and a client-supplied property.
https://issues.apache.org/jira/browse/ARTEMIS-6311