-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into expose-raw-response
- Loading branch information
Showing
18 changed files
with
428 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...e/src/main/java/graphql/kickstart/spring/webclient/boot/GraphQLClientRetryProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package graphql.kickstart.spring.webclient.boot; | ||
|
||
import java.time.Duration; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Primary; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
@Primary | ||
@ConfigurationProperties("graphql.client.retry") | ||
public class GraphQLClientRetryProperties { | ||
|
||
private RetryStrategy strategy = RetryStrategy.NONE; | ||
private RetryBackoff backoff = new RetryBackoff(); | ||
private RetryFixedDelay fixedDelay = new RetryFixedDelay(); | ||
private RetryMax max = new RetryMax(); | ||
private RetryMaxInRow maxInRow = new RetryMaxInRow(); | ||
|
||
@Data | ||
static class RetryBackoff { | ||
private long maxAttempts = -1; | ||
private Duration minBackoff = Duration.ofMillis(0); | ||
private Duration maxBackoff = Duration.ofMillis(Long.MAX_VALUE); | ||
} | ||
|
||
@Data | ||
static class RetryFixedDelay { | ||
private long maxAttempts = -1; | ||
private Duration delay = Duration.ofMillis(0); | ||
} | ||
|
||
@Data | ||
static class RetryMax { | ||
private long maxAttempts = -1; | ||
} | ||
|
||
@Data | ||
static class RetryMaxInRow { | ||
private long maxAttempts = -1; | ||
} | ||
|
||
enum RetryStrategy { | ||
BACKOFF, | ||
FIXED_DELAY, | ||
INDEFINITELY, | ||
MAX, | ||
MAX_IN_ROW, | ||
NONE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...va/graphql/kickstart/spring/webclient/boot/GraphQLWebClientRetryErrorFilterPredicate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package graphql.kickstart.spring.webclient.boot; | ||
|
||
import java.util.function.Predicate; | ||
|
||
public interface GraphQLWebClientRetryErrorFilterPredicate extends Predicate<Throwable> { | ||
} |
7 changes: 7 additions & 0 deletions
7
.../src/main/java/graphql/kickstart/spring/webclient/boot/GraphQLWebClientRetryProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package graphql.kickstart.spring.webclient.boot; | ||
|
||
import reactor.util.retry.Retry; | ||
|
||
public interface GraphQLWebClientRetryProvider { | ||
Retry get(); | ||
} |
Oops, something went wrong.