You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resilience4j version:
2.2.0
Java version:
OpenJDK 17.0.6
My application configures back-off retry as below:
long maxAttempts = 9999;
long initInterval = 5; // second
double multiplier = 1.1;
long maxInterval = 30; // second
Assume that my application will run into maxAttempts times.
Here is the scenario: My application runs on retry 10 times then my application is restarted. Assume that all configurations are saved into the database before restarting. So, when the application is started again the configurations are loaded into the back-off retry config. There is any way to make the back-off retry function continue on the 11th with the wait duration at the 11th(already ran 10 times as before) instead of beginning at the 1st
Here is the library code, the wait duration time based on numOfAttempts(ContextImpl):
private void waitIntervalAfterRuntimeException(int currentNumOfAttempts, Either<Throwable, T> either) {
// wait interval until the next attempt should start
long interval = intervalBiFunction.apply(numOfAttempts.get(), either);
if (interval < 0) {
publishRetryEvent(() -> new RetryOnErrorEvent(getName(), currentNumOfAttempts, either.swap().getOrNull()));
} else {
publishRetryEvent(() -> new RetryOnRetryEvent(getName(), currentNumOfAttempts, either.swap().getOrNull(), interval));
}
try {
sleepFunction.accept(interval);
} catch (Throwable ex) {
throw lastRuntimeException.get();
}
}
Hope that your side can help me on this.
The text was updated successfully, but these errors were encountered:
Hi,
unfortunately there is currently no way to boostrap the state of the Resilience4j components from a DB.
Would be a nice new feature, if you want to contribute it.
Resilience4j version:
2.2.0
Java version:
OpenJDK 17.0.6
My application configures back-off retry as below:
Assume that my application will run into
maxAttempts
times.Here is the scenario: My application runs on retry 10 times then my application is restarted. Assume that all configurations are saved into the database before restarting. So, when the application is started again the configurations are loaded into the back-off retry config. There is any way to make the back-off retry function continue on the 11th with the wait duration at the 11th(already ran 10 times as before) instead of beginning at the 1st
Here is the library code, the wait duration time based on
numOfAttempts
(ContextImpl):Hope that your side can help me on this.
The text was updated successfully, but these errors were encountered: