Hi Robert,

the code related to the redelivery-delay is the same in Apache ActiveMQ
Artemis 2.10.1 and 2.37.0 versions. This issue could be caused
by WFLY-19072[1], it sets the MaxRedeliveryDelay default value on the root
of AddressSettings to 0, see
https://github.com/wildfly/wildfly/commit/adf1c4eb41e1ebd69119fea9305ebfeba13ecf1a#diff-c841daa7f5b238a2987f4993f03c20610b65ac7dfb4b4382eea83663af40a079R79

[1] https://issues.redhat.com/browse/WFLY-19072

Regards,
Domenico

On Fri, 6 Dec 2024 at 08:51, Robert Palm <develo...@robert-palm.de> wrote:

>
> Updated from wildfy 19 (artemis version 2.10.1) to 34 (artemis version
> 2.37.0).
>
> The setting in my standalone.xml was: <address-setting
> name="jms.queue.TestQueue" redelivery-delay="600000" ....
>
> I needed to change it to: <address-setting name="jms.queue.TestQueue"
> redelivery-delay="600000" max-redelivery-delay="600000"....
>
> Trace says "Setting redeliveryDelay=0", which I found here:
>
> // Second check Redelivery Delay
> long redeliveryDelay = addressSettings.getRedeliveryDelay();
> if (!ignoreRedeliveryDelay && redeliveryDelay > 0) {
>     redeliveryDelay = calculateRedeliveryDelay(addressSettings,
> deliveryCount);
>
>     if (logger.isTraceEnabled()) {
>        logger.trace("Setting redeliveryDelay={} on reference={}",
> redeliveryDelay, reference);
>     }
>
> In the new version 2.37 the method
>
> private long calculateRedeliveryDelay(final AddressSettings
> addressSettings, final int deliveryCount) {
>     long redeliveryDelay = addressSettings.getRedeliveryDelay();
>     long maxRedeliveryDelay = addressSettings.getMaxRedeliveryDelay();
>     double redeliveryMultiplier =
> addressSettings.getRedeliveryMultiplier();
>     double collisionAvoidanceFactor =
> addressSettings.getRedeliveryCollisionAvoidanceFactor();
>
>     int tmpDeliveryCount = deliveryCount > 0 ? deliveryCount - 1 : 0;
>     long delay = (long) (redeliveryDelay *
> (Math.pow(redeliveryMultiplier, tmpDeliveryCount)));
>     if (collisionAvoidanceFactor > 0) {
>        Random random = ThreadLocalRandom.current();
>        double variance = (random.nextBoolean() ?
> collisionAvoidanceFactor : -collisionAvoidanceFactor) *
> random.nextDouble();
>        delay += (delay * variance);
>     }
>
>     if (delay > maxRedeliveryDelay) {
>        delay = maxRedeliveryDelay;
>     }
>
>     return delay;
> }
>
> is still the same as in the old version of artemis, but now leads to
> setting delay to 0 because I don't have max-redelivery-delay set at all:
>
> public long getMaxRedeliveryDelay() {
>     // default is redelivery-delay * 10 as specified on the docs and
> at this JIRA:
>     // https://issues.jboss.org/browse/HORNETQ-1263
>     return maxRedeliveryDelay != null ? maxRedeliveryDelay :
> (getRedeliveryDelay() * 10);
> }
>
> In the new version 2.37 there were changes made in
> org.apache.activemq.artemis.core.settings.impl.AddressSettings
>
> I think if the parameter max-redelivery-delay is not there it should
> fall back to redelivery-delay (in my case 600000) as an initialization
> parameter and not to 0.
>
> If you think so, too, please fix.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@activemq.apache.org
> For additional commands, e-mail: users-h...@activemq.apache.org
> For further information, visit: https://activemq.apache.org/contact
>
>
>

Reply via email to