Skip to content

Commit

Permalink
Modified RetrySettings (#3549)
Browse files Browse the repository at this point in the history
  • Loading branch information
anguillanneuf authored Aug 10, 2018
1 parent bef4b9d commit edc7aff
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ public Publisher getPublisherWithCustomRetrySettings(ProjectTopicName topicName)
Duration retryDelay = Duration.ofMillis(100); // default : 1 ms
double retryDelayMultiplier = 2.0; // back off for repeated failures
Duration maxRetryDelay = Duration.ofSeconds(5); // default : 10 seconds
Duration totalTimeout = Duration.ofSeconds(1); // default: 0
Duration initialRpcTimeout = Duration.ofSeconds(1); // default: 0
Duration maxRpcTimeout = Duration.ofSeconds(10); // default: 0

RetrySettings retrySettings = RetrySettings.newBuilder()
.setInitialRetryDelay(retryDelay)
.setRetryDelayMultiplier(retryDelayMultiplier)
.setMaxRetryDelay(maxRetryDelay)
.setTotalTimeout(totalTimeout)
.setInitialRpcTimeout(initialRpcTimeout)
.setMaxRpcTimeout(maxRpcTimeout)
.build();

Publisher publisher = Publisher.newBuilder(topicName)
Expand Down

0 comments on commit edc7aff

Please sign in to comment.