Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pubsub): expose CallOptions for pub/sub retries and timeouts #4428

Merged
merged 8 commits into from Aug 9, 2021

Conversation

hongalex
Copy link
Member

@hongalex hongalex commented Jul 13, 2021

In a similar vein to the spanner PR (#2599), this PR allows users to specify their own retry / timeout configurations for clients for the high level manual library. Default topic/subscription configs are configured in all the GAPIC libraries and are exposed there (cloud.google.com/go/pubsub/apiv1), but currently cannot be configured in the handwritten/manual library. This differs from the Spanner PR in that Pub/Sub requires specifying the publisher and subscriber options separately, requiring separate helper functions. Otherwise these functions are functionally identical to spanner.

Closes #4162

@hongalex hongalex requested review from a team as code owners July 13, 2021 21:42
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Jul 13, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 13, 2021

// mergePublisherCallOptions merges two PublisherCallOptions into one and the first argument has
// a lower order of precedence than the second one. If either is nil, return the other.
func mergePublisherCallOptions(a *vkit.PublisherCallOptions, b *vkit.PublisherCallOptions) *vkit.PublisherCallOptions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could write a generic "merge two structs of the same type" function, but this works fine. 👍

@hongalex hongalex merged commit 8b99dd3 into googleapis:master Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pubsub: Allow to override PublisherClient default CallOptions in pubsub.NewClient
2 participants