Skip to content

Commit

Permalink
(docs) update readme with usage for RetryException
Browse files Browse the repository at this point in the history
  • Loading branch information
puncleV committed Nov 7, 2024
1 parent f3459fd commit ca62cc6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions riptide-failsafe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ RetryPolicy.<ClientHttpResponse>builder()
.build();
```

By default, you can use RetryException in your routes to retry the request:

```java
retryClient.get()
.dispatch(
series(), on(CLIENT_ERROR).call(
response -> {
if (specificCondition(response)) {
throw new RetryException(response); // we will retry this one
} else {
throw new AnyOtherException(response); // we wont retry this one
}
}
)
).join()
```

Failsafe supports dynamically computed delays using a custom function.

Riptide: Failsafe offers implementations that understand:
Expand Down

0 comments on commit ca62cc6

Please sign in to comment.