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

Add retention duraction, retain acked message to pubsub #1481

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions products/pubsub/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ overrides: !ruby/object:Overrides::ResourceOverrides
properties:
labels: !ruby/object:Overrides::Ansible::PropertyOverride
version_added: '2.8'
messageRetentionDuration: !ruby/object:Overrides::Ansible::PropertyOverride
version_added: '2.8'
retainAckedMessages: !ruby/object:Overrides::Ansible::PropertyOverride
version_added: '2.8'
transport: !ruby/object:Api::Resource::Transport
encoder: encode_request
decoder: decode_request
Expand Down
20 changes: 20 additions & 0 deletions products/pubsub/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,23 @@ objects:

If the subscriber never acknowledges the message, the Pub/Sub system
will eventually redeliver the message.
- !ruby/object:Api::Type::String
name: 'messageRetentionDuration'
default_value: '604800s'
description: |
How long to retain unacknowledged messages in the subscription's
backlog, from the moment a message is published. If
retainAckedMessages is true, then this also configures the retention
of acknowledged messages, and thus configures how far back in time a
subscriptions.seek can be done. Defaults to 7 days. Cannot be more
than 7 days (`"604800s"`) or less than 10 minutes (`"600s"`).

A duration in seconds with up to nine fractional digits, terminated
by 's'. Example: `"600.5s"`.
- !ruby/object:Api::Type::Boolean
name: 'retainAckedMessages'
description: |
Indicates whether to retain acknowledged messages. If `true`, then
rileykarson marked this conversation as resolved.
Show resolved Hide resolved
messages are not expunged from the subscription's backlog, even if
they are acknowledged, until they fall out of the
messageRetentionDuration window.
4 changes: 4 additions & 0 deletions templates/terraform/examples/pubsub_subscription_pull.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %>" {
foo = "bar"
}

# 20 minutes
message_retention_duration = "1200s"
retain_acked_messages = true

ack_deadline_seconds = 20
}