Skip to content

feat(pubsub): add topic message retention duration#4520

Merged
hongalex merged 19 commits intomasterfrom
pubsub_dev
Aug 24, 2021
Merged

feat(pubsub): add topic message retention duration#4520
hongalex merged 19 commits intomasterfrom
pubsub_dev

Conversation

@hongalex
Copy link
Copy Markdown
Member

@hongalex hongalex commented Jul 30, 2021

This PR adds support for topic retention duration. This is a new field that can be set on topic creation, and can also be changed by calling topic.Update. If set to a negative value for an Update, this clears the retention duration from the topic.

@hongalex hongalex requested review from a team July 30, 2021 05:13
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Jul 30, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 30, 2021
Comment thread pubsub/subscription.go
Comment thread pubsub/subscription.go Outdated
// messages published to the subscription's topic in the last
// `TopicMessageRetentionDuration` are always available to subscribers.
//
// This field is set only in responses from the server and otherwise ignored.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be clear: this is an "output only" field? I know this isn't a proto field, but just want to clarify with https://google.aip.dev/203#output-only

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, this is an output only field, correspondig to https://github.com/googleapis/googleapis/blob/ba30d8097582039ac4cc4e21b4e4baa426423075/google/pubsub/v1/pubsub.proto#L761.

Should I explicitly add this to the comments here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should I explicitly add this to the comments here?

It's fine the way it is, but maybe it would be clearer to say This is an output only field, meaning it will only appear in responses from the backend and will be ignored if sent in a request. You could include the link too if you feel it would be helpful.

No change is really needed, just wanted to clarify for myself.

Comment thread pubsub/topic.go Outdated
Comment thread pubsub/topic.go Outdated
Comment thread pubsub/topic.go Outdated
Comment thread pubsub/topic.go Outdated
Copy link
Copy Markdown
Contributor

@noahdietz noahdietz left a comment

Choose a reason for hiding this comment

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

LGTM for general review.

Comment thread pubsub/subscription.go
Comment thread pubsub/topic.go Outdated
Comment thread pubsub/topic.go Outdated
@hongalex hongalex merged commit 0440336 into master Aug 24, 2021
@hongalex hongalex deleted the pubsub_dev branch August 24, 2021 23:18
BrennaEpp pushed a commit to BrennaEpp/google-cloud-go that referenced this pull request Aug 27, 2021
* feat(pubsub): add message retention duration feature

* feat(pubsub): add topic message retention duration

* comment fixes

* switch to optional.Duration

* remove staging endpoint

* address review comments

* remove unused instance of message retention duration in publishsettings

* revert sentinel value check

* clarify doc comments

* fix retention duration comments
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.

3 participants