T - the feign interface typepublic interface FallbackFactory<T>
// This instance will be invoked if there are errors of any kind.
FallbackFactory<GitHub> fallbackFactory = cause -> (owner, repo) -> {
if (cause instanceof FeignException && ((FeignException) cause).status() == 403) {
return Collections.emptyList();
} else {
return Arrays.asList("yogi");
}
};
GitHub github = FeignCircuitBreaker.builder()
...
.target(GitHub.class, "https://api.github.com", fallbackFactory);
| Modifier and Type | Interface and Description |
|---|---|
static class |
FallbackFactory.Default<T> |
| Modifier and Type | Method and Description |
|---|---|
T |
create(Throwable cause)
Returns an instance of the fallback appropriate for the given cause.
|
Copyright © 2023 Pivotal Software, Inc.. All rights reserved.