Skip to content

Commit

Permalink
Add retention duraction, retain acked message to pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson committed Mar 5, 2019
1 parent aa07fe3 commit 4755ed7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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
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
}

0 comments on commit 4755ed7

Please sign in to comment.