Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
c9ccc087
Commit
c9ccc087
authored
3 years ago
by
Neelesh Thakur
Browse files
Options
Downloads
Patches
Plain Diff
switch to exponential backoff instead of fixed interval
parent
5233208f
No related branches found
No related tags found
1 merge request
!207
switch to exponential backoff instead of fixed interval
Pipeline
#67792
failed
3 years ago
Stage: .pre
Stage: review
Stage: build
Stage: containerize
Stage: scan
Stage: deploy
Stage: integration
Stage: attribution
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/service/RetryPolicy.java
+5
-5
5 additions, 5 deletions
...org/opengroup/osdu/indexer/azure/service/RetryPolicy.java
with
5 additions
and
5 deletions
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/service/RetryPolicy.java
+
5
−
5
View file @
c9ccc087
...
...
@@ -18,6 +18,7 @@ import com.google.gson.JsonArray;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
io.github.resilience4j.core.IntervalFunction
;
import
io.github.resilience4j.retry.RetryConfig
;
import
lombok.Data
;
import
lombok.extern.java.Log
;
...
...
@@ -27,7 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
java.time.Duration
;
import
java.util.function.Predicate
;
/**
...
...
@@ -44,8 +44,8 @@ public class RetryPolicy {
@Autowired
private
JaxRsDpsLog
logger
;
private
int
attempts
=
3
;
private
int
waitDuration
=
1000
;
private
static
int
MAX_ATTEMPTS
=
5
;
private
static
int
INITIAL_DELAY
=
1000
;
private
final
String
RECORD_NOT_FOUND
=
"notFound"
;
/**
...
...
@@ -53,8 +53,8 @@ public class RetryPolicy {
*/
public
RetryConfig
retryConfig
(
Predicate
<
HttpResponse
>
predicate
)
{
return
RetryConfig
.<
HttpResponse
>
custom
()
.
maxAttempts
(
attempts
)
.
waitDuration
(
Duration
.
ofMillis
(
waitDuration
))
.
maxAttempts
(
MAX_ATTEMPTS
)
.
intervalFunction
(
IntervalFunction
.
ofExponentialBackoff
(
INITIAL_DELAY
,
2
))
.
retryOnResult
(
predicate
)
.
build
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment