Skip to content

Update RetrySettings guide to use the java.time methods #11027

@alicejli

Description

@alicejli

https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md has some sample code that uses the gax methods for setting RetrySettings that use java.threeten. Given googleapis/sdk-platform-java#1872 has been merged, we should update the guide to make use of the new methods that use java.time to encourage users to use those methods instead.

For example:

settings =
    RetrySettings.newBuilder()
    .setInitialRpcTimeout(Duration.ofMillis(60000L))
    .setRpcTimeoutMultiplier(1.0)
    .setMaxRpcTimeout(Duration.ofMillis(60000L))
    .setTotalTimeout(Duration.ofMillis(60000L))
    .build();

should be rewritten to:

settings =
    RetrySettings.newBuilder()
    .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L))
    .setRpcTimeoutMultiplier(1.0)
    .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L))
    .setTotalTimeoutDuration(Duration.ofMillis(60000L))
    .build();

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions