|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2024 the original author or authors. |
|
|
|
* Copyright 2002-2025 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -194,7 +194,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe |
|
|
|
|
|
|
|
|
|
|
|
private boolean virtualThreads = false; |
|
|
|
private boolean virtualThreads = false; |
|
|
|
|
|
|
|
|
|
|
|
private BackOff backOff = new FixedBackOff(DEFAULT_RECOVERY_INTERVAL, Long.MAX_VALUE); |
|
|
|
private BackOff backOff = new FixedBackOff(DEFAULT_RECOVERY_INTERVAL); |
|
|
|
|
|
|
|
|
|
|
|
private int cacheLevel = CACHE_AUTO; |
|
|
|
private int cacheLevel = CACHE_AUTO; |
|
|
|
|
|
|
|
|
|
|
|
@ -278,8 +278,8 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe |
|
|
|
* between recovery attempts. If the {@link BackOffExecution} implementation |
|
|
|
* between recovery attempts. If the {@link BackOffExecution} implementation |
|
|
|
* returns {@link BackOffExecution#STOP}, this listener container will not further |
|
|
|
* returns {@link BackOffExecution#STOP}, this listener container will not further |
|
|
|
* attempt to recover. |
|
|
|
* attempt to recover. |
|
|
|
* <p>The {@link #setRecoveryInterval(long) recovery interval} is ignored |
|
|
|
* <p>Note that setting the {@linkplain #setRecoveryInterval(long) recovery |
|
|
|
* when this property is set. |
|
|
|
* interval} overrides this property. |
|
|
|
* @since 4.1 |
|
|
|
* @since 4.1 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setBackOff(BackOff backOff) { |
|
|
|
public void setBackOff(BackOff backOff) { |
|
|
|
@ -288,15 +288,17 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Specify the interval between recovery attempts, in <b>milliseconds</b>. |
|
|
|
* Specify the interval between recovery attempts, in <b>milliseconds</b>. |
|
|
|
* The default is 5000 ms, that is, 5 seconds. This is a convenience method |
|
|
|
* <p>The default is 5000 ms, that is, 5 seconds. |
|
|
|
* to create a {@link FixedBackOff} with the specified interval. |
|
|
|
* <p>This is a convenience method to create a {@link FixedBackOff} with the |
|
|
|
* <p>For more recovery options, consider specifying a {@link BackOff} |
|
|
|
* specified interval. For more recovery options, consider specifying a |
|
|
|
* instance instead. |
|
|
|
* {@link #setBackOff(BackOff) BackOff} instance instead. Note, however, that |
|
|
|
|
|
|
|
* explicitly setting the {@link #setBackOff(BackOff) BackOff} overrides this |
|
|
|
|
|
|
|
* property. |
|
|
|
* @see #setBackOff(BackOff) |
|
|
|
* @see #setBackOff(BackOff) |
|
|
|
* @see #handleListenerSetupFailure |
|
|
|
* @see #handleListenerSetupFailure |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setRecoveryInterval(long recoveryInterval) { |
|
|
|
public void setRecoveryInterval(long recoveryInterval) { |
|
|
|
this.backOff = new FixedBackOff(recoveryInterval, Long.MAX_VALUE); |
|
|
|
this.backOff = new FixedBackOff(recoveryInterval); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|