-
Hi! I have an try{
asyncClient.getSecretValue();
catch (ResourceNotFoundException e){
throw new VaultException();
}
catch (RuntimeException e){
retry();
}
} With mutiny I was trying something like Uni<EventBridgeSecret> a = Uni.createFrom().future(asyncClient.getSecretValue(
GetSecretValueRequest.builder()
.secretId(name)
.build()))
.onFailure(ResourceNotFoundException.class).transform(e -> new VaultException("Secret '%s' not found in AWS Vault", e))
.onFailure(e -> !(e instanceof ResourceNotFoundException)).retry().withJitter(DEFAULT_JITTER).withBackOff(DEFAULT_BACKOFF).atMost(MAX_RETRIES); But of course the second Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Shouldn't the onFailure predicate use |
Beta Was this translation helpful? Give feedback.
-
Hi @cescoffier , |
Beta Was this translation helpful? Give feedback.
-
Have you tried swapping the 2 |
Beta Was this translation helpful? Give feedback.
-
Hi @jponge , I tried with
and it did the trick as you suggested. I guess I did not spot it because I was previously using @Override
public Uni<Void> test(){
return Uni.createFrom().failure(new VaultException(""))
.replaceWithVoid()
.onFailure(e -> !(e instanceof VaultException)).retry().until(x -> {LOGGER.info("ARGUMENT!"); return false;})
.onFailure(VaultException.class).retry().until(x -> {LOGGER.info("VAULT!"); return false;});
} prints
when called. I would expect only |
Beta Was this translation helpful? Give feedback.
-
Resolved by @cescoffier in #817 |
Beta Was this translation helpful? Give feedback.
Resolved by @cescoffier in #817