-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
info: workaround availableA workaround is available for the issueA workaround is available for the issuetype: enhancementNew feature or requestNew feature or request
Description
Feature description
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 = -60
public String getValue(String someParameter){
// 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 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
micronaut:
redis:
retry:
read: 2 # Retry twice on failure
insert: 2 # This triggers insert retry
The given example solution is just for inspiration purposes!
Metadata
Metadata
Assignees
Labels
info: workaround availableA workaround is available for the issueA workaround is available for the issuetype: enhancementNew feature or requestNew feature or request