Skip to content
Permalink
Browse files
fix: Set publish timeouts to be consistent with desired values (#820)
* feat: Add flow control support to publisher

* make suggested fixes

* chore: Remove note that ordering keys requires enablements.

* feat: Add support for server-side flow control

* Revert "chore: Remove note that ordering keys requires enablements."

This reverts commit 9c113c3.

* fix: Fix import order

* fix: Make error message more clear about where ordering must be enabled when publishing.

* fix: Ensure that messages that are in pending batches for an ordering key are canceled when a previous publish for the ordering keys fails.

* fix: Only check keyHasError if ordering keys is non-empty

* fix: Set publish timeouts to be consistent with desired values
  • Loading branch information
kamalaboulhosn committed Aug 31, 2021
1 parent b1cfb99 commit 826dc10f5bb373e88b06d390fc2029960a2cad7c
Showing with 8 additions and 5 deletions.
  1. +8 −5 google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java
@@ -657,8 +657,11 @@ public static final class Builder {
static final long DEFAULT_REQUEST_BYTES_THRESHOLD = 1000L; // 1 kB
static final Duration DEFAULT_DELAY_THRESHOLD = Duration.ofMillis(1);
private static final Duration DEFAULT_INITIAL_RPC_TIMEOUT = Duration.ofSeconds(5);
private static final Duration DEFAULT_MAX_RPC_TIMEOUT = Duration.ofSeconds(600);
private static final Duration DEFAULT_MAX_RPC_TIMEOUT = Duration.ofSeconds(60);
private static final Duration DEFAULT_TOTAL_TIMEOUT = Duration.ofSeconds(600);
private static final Duration DEFAULT_INITIAL_RETRY_DELAY = Duration.ofMillis(100);
private static final Duration DEFAULT_MAX_RETRY_DELAY = Duration.ofSeconds(60);
private static final double DEFAULT_MULTIPLIER = 1.3;
static final BatchingSettings DEFAULT_BATCHING_SETTINGS =
BatchingSettings.newBuilder()
.setDelayThreshold(DEFAULT_DELAY_THRESHOLD)
@@ -672,11 +675,11 @@ public static final class Builder {
static final RetrySettings DEFAULT_RETRY_SETTINGS =
RetrySettings.newBuilder()
.setTotalTimeout(DEFAULT_TOTAL_TIMEOUT)
.setInitialRetryDelay(Duration.ofMillis(100))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofSeconds(60))
.setInitialRetryDelay(DEFAULT_INITIAL_RETRY_DELAY)
.setRetryDelayMultiplier(DEFAULT_MULTIPLIER)
.setMaxRetryDelay(DEFAULT_MAX_RETRY_DELAY)
.setInitialRpcTimeout(DEFAULT_INITIAL_RPC_TIMEOUT)
.setRpcTimeoutMultiplier(1)
.setRpcTimeoutMultiplier(DEFAULT_MULTIPLIER)
.setMaxRpcTimeout(DEFAULT_MAX_RPC_TIMEOUT)
.build();
static final boolean DEFAULT_ENABLE_MESSAGE_ORDERING = false;

0 comments on commit 826dc10

Please sign in to comment.