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
I would like to be able to retry reading from and writing into Redis, when the connection to redis is lost.
Our current problem is the following:
@Cacheable// (1) InterceptPhase = -100@Retryable// (2) InterceptPhase = -60publicStringgetValue(StringsomeParameter){
// calling remote service that can fail (3)return"value"
}
(4)
Explaination:
@Cacheable checks if this method with the given parameter is in our Cache (Redis) If it is found, the cache hit will return immediatly our desired value. This interceptor kicks in first, since its intercept Phase is lower than @Retryable
@Retryable will retry in case of failures of computing our desired value (i.e. calls a remote service). For simplicity reasons it just shall retry on any problem.
Calling a remote service that fails is covered by retryable
When this method return as value @Cacheable will store the result within our cache. Unfortunatly this cache is a remote service, which can also fail. We could see a few Connection reset issues.
Problem / Feature 1: Reading from Redis can fail and should be retried
Problem / Feature 2: Writing into Redis can fail and should be retried
Having this scenario, i would love to see something like
micronaut:
redis:
retry:
read: 2# Retry twice on failureinsert: 2# This triggers insert retry
The given example solution is just for inspiration purposes!
The text was updated successfully, but these errors were encountered:
debrutal
changed the title
Provide an option to retry a failed cache insert.
Provide an option to retry a failed cache insert or read
Apr 3, 2023
While not saying it is a sane Solution, but it still can work, assuming you have a more fine grained Exception identification.
One workaround is to wrap the @Cacheable in a Retry method.
The following sample, calling doSomething() shows how the execution order is.
Feature description
I would like to be able to retry
reading from
andwriting into
Redis, when the connection to redis is lost.Our current problem is the following:
Explaination:
@Cacheable
checks if this method with the given parameter is in our Cache (Redis) If it is found, the cache hit will return immediatly our desired value. This interceptor kicks in first, since its intercept Phase is lower than@Retryable
@Retryable
will retry in case of failures of computing our desired value (i.e. calls a remote service). For simplicity reasons it just shall retry on any problem.@Cacheable
will store the result within our cache. Unfortunatly this cache is a remote service, which can also fail. We could see a fewConnection reset
issues.Problem / Feature 1: Reading from Redis can fail and should be retried
Problem / Feature 2: Writing into Redis can fail and should be retried
Having this scenario, i would love to see something like
The given example solution is just for inspiration purposes!
The text was updated successfully, but these errors were encountered: