From 36232266a3515b3a0e79bbe8aaa7b44790019e38 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Tue, 10 Sep 2024 17:23:51 +0000 Subject: [PATCH] chore: generate libraries at Tue Sep 10 17:21:27 UTC 2024 --- .../pubsublite/v1/AdminServiceSettings.java | 42 ++++++++++++- .../pubsublite/v1/CursorServiceSettings.java | 17 ++++- .../PartitionAssignmentServiceSettings.java | 17 ++++- .../v1/PublisherServiceSettings.java | 17 ++++- .../v1/SubscriberServiceSettings.java | 17 ++++- .../v1/TopicStatsServiceSettings.java | 17 ++++- .../v1/stub/AdminServiceStubSettings.java | 63 ++++++++++++++----- .../v1/stub/CursorServiceStubSettings.java | 21 +++++-- ...artitionAssignmentServiceStubSettings.java | 17 ++++- .../v1/stub/PublisherServiceStubSettings.java | 17 ++++- .../stub/SubscriberServiceStubSettings.java | 17 ++++- .../stub/TopicStatsServiceStubSettings.java | 17 ++++- .../createtopic/SyncCreateTopic.java | 9 ++- .../SyncSeekSubscription.java | 53 ++++++++++++++++ .../commitcursor/SyncCommitCursor.java | 9 ++- .../SyncAssignPartitions.java | 9 ++- .../publish/SyncPublish.java | 9 ++- .../createtopic/SyncCreateTopic.java | 9 ++- .../SyncSeekSubscription.java | 54 ++++++++++++++++ .../commitcursor/SyncCommitCursor.java | 9 ++- .../SyncAssignPartitions.java | 9 ++- .../publish/SyncPublish.java | 9 ++- .../subscribe/SyncSubscribe.java | 9 ++- .../SyncComputeMessageStats.java | 9 ++- .../subscribe/SyncSubscribe.java | 9 ++- .../SyncComputeMessageStats.java | 9 ++- 26 files changed, 440 insertions(+), 54 deletions(-) create mode 100644 samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/seeksubscription/SyncSeekSubscription.java create mode 100644 samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/seeksubscription/SyncSeekSubscription.java diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/AdminServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/AdminServiceSettings.java index bd1e58a5f..118c2c706 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/AdminServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/AdminServiceSettings.java @@ -85,7 +85,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of createTopic to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -101,10 +103,46 @@
  *             .createTopicSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * AdminServiceSettings adminServiceSettings = adminServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for seekSubscription: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdminServiceSettings.Builder adminServiceSettingsBuilder = AdminServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * adminServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AdminServiceSettings extends ClientSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/CursorServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/CursorServiceSettings.java index 2e144837e..9e3d08ada 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/CursorServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/CursorServiceSettings.java @@ -55,7 +55,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of commitCursor to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of commitCursor: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -71,10 +73,21 @@
  *             .commitCursorSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * CursorServiceSettings cursorServiceSettings = cursorServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class CursorServiceSettings extends ClientSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PartitionAssignmentServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PartitionAssignmentServiceSettings.java index c704f9ede..dfb77ad4f 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PartitionAssignmentServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PartitionAssignmentServiceSettings.java @@ -48,7 +48,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of assignPartitions to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of assignPartitions: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -65,11 +67,22 @@
  *             .assignPartitionsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * PartitionAssignmentServiceSettings partitionAssignmentServiceSettings =
  *     partitionAssignmentServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PartitionAssignmentServiceSettings diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PublisherServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PublisherServiceSettings.java index 910857dd3..8e7ad311b 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PublisherServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/PublisherServiceSettings.java @@ -48,7 +48,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of publish to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of publish: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -65,10 +67,21 @@
  *             .publishSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * PublisherServiceSettings publisherServiceSettings = publisherServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PublisherServiceSettings extends ClientSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/SubscriberServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/SubscriberServiceSettings.java index 0cd4da4c3..2e5908cb3 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/SubscriberServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/SubscriberServiceSettings.java @@ -48,7 +48,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of subscribe to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of subscribe: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -65,10 +67,21 @@
  *             .subscribeSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * SubscriberServiceSettings subscriberServiceSettings = subscriberServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SubscriberServiceSettings extends ClientSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/TopicStatsServiceSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/TopicStatsServiceSettings.java index 9a8542826..77ae29106 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/TopicStatsServiceSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/TopicStatsServiceSettings.java @@ -51,7 +51,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of computeMessageStats to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of computeMessageStats: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -68,10 +70,21 @@
  *             .computeMessageStatsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * TopicStatsServiceSettings topicStatsServiceSettings = topicStatsServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class TopicStatsServiceSettings extends ClientSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/AdminServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/AdminServiceStubSettings.java index 0c48a7063..fe8b6a940 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/AdminServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/AdminServiceStubSettings.java @@ -104,7 +104,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of createTopic to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -121,10 +123,47 @@
  *             .createTopicSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * AdminServiceStubSettings adminServiceSettings = adminServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for seekSubscription: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdminServiceStubSettings.Builder adminServiceSettingsBuilder =
+ *     AdminServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * adminServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class AdminServiceStubSettings extends StubSettings { @@ -201,9 +240,7 @@ public String extractNextToken(ListTopicsResponse payload) { @Override public Iterable extractResources(ListTopicsResponse payload) { - return payload.getTopicsList() == null - ? ImmutableList.of() - : payload.getTopicsList(); + return payload.getTopicsList(); } }; @@ -243,9 +280,7 @@ public String extractNextToken(ListTopicSubscriptionsResponse payload) { @Override public Iterable extractResources(ListTopicSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); + return payload.getSubscriptionsList(); } }; @@ -283,9 +318,7 @@ public String extractNextToken(ListSubscriptionsResponse payload) { @Override public Iterable extractResources(ListSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); + return payload.getSubscriptionsList(); } }; @@ -323,9 +356,7 @@ public String extractNextToken(ListReservationsResponse payload) { @Override public Iterable extractResources(ListReservationsResponse payload) { - return payload.getReservationsList() == null - ? ImmutableList.of() - : payload.getReservationsList(); + return payload.getReservationsList(); } }; @@ -363,9 +394,7 @@ public String extractNextToken(ListReservationTopicsResponse payload) { @Override public Iterable extractResources(ListReservationTopicsResponse payload) { - return payload.getTopicsList() == null - ? ImmutableList.of() - : payload.getTopicsList(); + return payload.getTopicsList(); } }; diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/CursorServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/CursorServiceStubSettings.java index cb5006bf3..f569a8e71 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/CursorServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/CursorServiceStubSettings.java @@ -72,7 +72,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of commitCursor to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of commitCursor: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -89,10 +91,21 @@
  *             .commitCursorSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * CursorServiceStubSettings cursorServiceSettings = cursorServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class CursorServiceStubSettings extends StubSettings { @@ -144,9 +157,7 @@ public String extractNextToken(ListPartitionCursorsResponse payload) { @Override public Iterable extractResources( ListPartitionCursorsResponse payload) { - return payload.getPartitionCursorsList() == null - ? ImmutableList.of() - : payload.getPartitionCursorsList(); + return payload.getPartitionCursorsList(); } }; diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PartitionAssignmentServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PartitionAssignmentServiceStubSettings.java index fe59639d6..e536cb515 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PartitionAssignmentServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PartitionAssignmentServiceStubSettings.java @@ -57,7 +57,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of assignPartitions to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of assignPartitions: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -74,11 +76,22 @@
  *             .assignPartitionsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * PartitionAssignmentServiceStubSettings partitionAssignmentServiceSettings =
  *     partitionAssignmentServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PartitionAssignmentServiceStubSettings diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PublisherServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PublisherServiceStubSettings.java index db7e7f086..09219bfee 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PublisherServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/PublisherServiceStubSettings.java @@ -57,7 +57,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of publish to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of publish: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -74,10 +76,21 @@
  *             .publishSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * PublisherServiceStubSettings publisherServiceSettings = publisherServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class PublisherServiceStubSettings extends StubSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/SubscriberServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/SubscriberServiceStubSettings.java index 46587bd7e..410cd35ce 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/SubscriberServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/SubscriberServiceStubSettings.java @@ -57,7 +57,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of subscribe to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of subscribe: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -74,11 +76,22 @@
  *             .subscribeSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * SubscriberServiceStubSettings subscriberServiceSettings =
  *     subscriberServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class SubscriberServiceStubSettings extends StubSettings { diff --git a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/TopicStatsServiceStubSettings.java b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/TopicStatsServiceStubSettings.java index cd57a174e..f0630bc15 100644 --- a/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/TopicStatsServiceStubSettings.java +++ b/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/v1/stub/TopicStatsServiceStubSettings.java @@ -61,7 +61,9 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of computeMessageStats to 30 seconds: + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of computeMessageStats: * *

{@code
  * // This snippet has been automatically generated and should be regarded as a code template only.
@@ -78,11 +80,22 @@
  *             .computeMessageStatsSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
  *             .build());
  * TopicStatsServiceStubSettings topicStatsServiceSettings =
  *     topicStatsServiceSettingsBuilder.build();
  * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. */ @Generated("by gapic-generator-java") public class TopicStatsServiceStubSettings extends StubSettings { diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/createtopic/SyncCreateTopic.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/createtopic/SyncCreateTopic.java index 000463683..ce655ca06 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/createtopic/SyncCreateTopic.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/createtopic/SyncCreateTopic.java @@ -40,7 +40,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AdminServiceSettings adminServiceSettings = adminServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/seeksubscription/SyncSeekSubscription.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/seeksubscription/SyncSeekSubscription.java new file mode 100644 index 000000000..4e7cfa332 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/adminservicesettings/seeksubscription/SyncSeekSubscription.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.pubsublite.v1.samples; + +// [START pubsublite_v1_generated_AdminServiceSettings_SeekSubscription_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.pubsublite.v1.AdminServiceSettings; +import java.time.Duration; + +public class SyncSeekSubscription { + + public static void main(String[] args) throws Exception { + syncSeekSubscription(); + } + + public static void syncSeekSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdminServiceSettings.Builder adminServiceSettingsBuilder = AdminServiceSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + adminServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END pubsublite_v1_generated_AdminServiceSettings_SeekSubscription_sync] diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/cursorservicesettings/commitcursor/SyncCommitCursor.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/cursorservicesettings/commitcursor/SyncCommitCursor.java index 399460089..1fd3a13d7 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/cursorservicesettings/commitcursor/SyncCommitCursor.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/cursorservicesettings/commitcursor/SyncCommitCursor.java @@ -40,7 +40,14 @@ public static void syncCommitCursor() throws Exception { .commitCursorSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); CursorServiceSettings cursorServiceSettings = cursorServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/partitionassignmentservicesettings/assignpartitions/SyncAssignPartitions.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/partitionassignmentservicesettings/assignpartitions/SyncAssignPartitions.java index 444bfa2ff..772edc777 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/partitionassignmentservicesettings/assignpartitions/SyncAssignPartitions.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/partitionassignmentservicesettings/assignpartitions/SyncAssignPartitions.java @@ -41,7 +41,14 @@ public static void syncAssignPartitions() throws Exception { .assignPartitionsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PartitionAssignmentServiceSettings partitionAssignmentServiceSettings = partitionAssignmentServiceSettingsBuilder.build(); diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/publisherservicesettings/publish/SyncPublish.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/publisherservicesettings/publish/SyncPublish.java index 885c403c7..7e09b98cf 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/publisherservicesettings/publish/SyncPublish.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/publisherservicesettings/publish/SyncPublish.java @@ -41,7 +41,14 @@ public static void syncPublish() throws Exception { .publishSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PublisherServiceSettings publisherServiceSettings = publisherServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/createtopic/SyncCreateTopic.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/createtopic/SyncCreateTopic.java index a62c7b7e1..bfe603571 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/createtopic/SyncCreateTopic.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/createtopic/SyncCreateTopic.java @@ -41,7 +41,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); AdminServiceStubSettings adminServiceSettings = adminServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/seeksubscription/SyncSeekSubscription.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/seeksubscription/SyncSeekSubscription.java new file mode 100644 index 000000000..c82938e1b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/adminservicestubsettings/seeksubscription/SyncSeekSubscription.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.pubsublite.v1.stub.samples; + +// [START pubsublite_v1_generated_AdminServiceStubSettings_SeekSubscription_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.pubsublite.v1.stub.AdminServiceStubSettings; +import java.time.Duration; + +public class SyncSeekSubscription { + + public static void main(String[] args) throws Exception { + syncSeekSubscription(); + } + + public static void syncSeekSubscription() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdminServiceStubSettings.Builder adminServiceSettingsBuilder = + AdminServiceStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + adminServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END pubsublite_v1_generated_AdminServiceStubSettings_SeekSubscription_sync] diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/cursorservicestubsettings/commitcursor/SyncCommitCursor.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/cursorservicestubsettings/commitcursor/SyncCommitCursor.java index 0d176038b..96f2a4632 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/cursorservicestubsettings/commitcursor/SyncCommitCursor.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/cursorservicestubsettings/commitcursor/SyncCommitCursor.java @@ -41,7 +41,14 @@ public static void syncCommitCursor() throws Exception { .commitCursorSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); CursorServiceStubSettings cursorServiceSettings = cursorServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/partitionassignmentservicestubsettings/assignpartitions/SyncAssignPartitions.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/partitionassignmentservicestubsettings/assignpartitions/SyncAssignPartitions.java index c9996eacb..0dbfe14fc 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/partitionassignmentservicestubsettings/assignpartitions/SyncAssignPartitions.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/partitionassignmentservicestubsettings/assignpartitions/SyncAssignPartitions.java @@ -41,7 +41,14 @@ public static void syncAssignPartitions() throws Exception { .assignPartitionsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PartitionAssignmentServiceStubSettings partitionAssignmentServiceSettings = partitionAssignmentServiceSettingsBuilder.build(); diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/publisherservicestubsettings/publish/SyncPublish.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/publisherservicestubsettings/publish/SyncPublish.java index 39a45b512..bbe1ab1b8 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/publisherservicestubsettings/publish/SyncPublish.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/publisherservicestubsettings/publish/SyncPublish.java @@ -41,7 +41,14 @@ public static void syncPublish() throws Exception { .publishSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); PublisherServiceStubSettings publisherServiceSettings = publisherServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/subscriberservicestubsettings/subscribe/SyncSubscribe.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/subscriberservicestubsettings/subscribe/SyncSubscribe.java index d85b26817..ee362569e 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/subscriberservicestubsettings/subscribe/SyncSubscribe.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/subscriberservicestubsettings/subscribe/SyncSubscribe.java @@ -41,7 +41,14 @@ public static void syncSubscribe() throws Exception { .subscribeSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SubscriberServiceStubSettings subscriberServiceSettings = subscriberServiceSettingsBuilder.build(); diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/topicstatsservicestubsettings/computemessagestats/SyncComputeMessageStats.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/topicstatsservicestubsettings/computemessagestats/SyncComputeMessageStats.java index fe20fde70..6f70c3ab8 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/topicstatsservicestubsettings/computemessagestats/SyncComputeMessageStats.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/stub/topicstatsservicestubsettings/computemessagestats/SyncComputeMessageStats.java @@ -41,7 +41,14 @@ public static void syncComputeMessageStats() throws Exception { .computeMessageStatsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); TopicStatsServiceStubSettings topicStatsServiceSettings = topicStatsServiceSettingsBuilder.build(); diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/subscriberservicesettings/subscribe/SyncSubscribe.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/subscriberservicesettings/subscribe/SyncSubscribe.java index 9981cf6ad..09f5146e6 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/subscriberservicesettings/subscribe/SyncSubscribe.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/subscriberservicesettings/subscribe/SyncSubscribe.java @@ -41,7 +41,14 @@ public static void syncSubscribe() throws Exception { .subscribeSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); SubscriberServiceSettings subscriberServiceSettings = subscriberServiceSettingsBuilder.build(); } diff --git a/samples/snippets/generated/com/google/cloud/pubsublite/v1/topicstatsservicesettings/computemessagestats/SyncComputeMessageStats.java b/samples/snippets/generated/com/google/cloud/pubsublite/v1/topicstatsservicesettings/computemessagestats/SyncComputeMessageStats.java index 3120b5b59..bbfd0bafd 100644 --- a/samples/snippets/generated/com/google/cloud/pubsublite/v1/topicstatsservicesettings/computemessagestats/SyncComputeMessageStats.java +++ b/samples/snippets/generated/com/google/cloud/pubsublite/v1/topicstatsservicesettings/computemessagestats/SyncComputeMessageStats.java @@ -41,7 +41,14 @@ public static void syncComputeMessageStats() throws Exception { .computeMessageStatsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) .build()); TopicStatsServiceSettings topicStatsServiceSettings = topicStatsServiceSettingsBuilder.build(); }