Cloud Pub/Sub API - Class Google::Cloud::PubSub::RetryPolicy (v2.15.2)

Reference documentation and code samples for the Cloud Pub/Sub API class Google::Cloud::PubSub::RetryPolicy.

RetryPolicy

An immutable Retry Policy value object that specifies how Cloud Pub/Sub retries message delivery.

Retry delay will be exponential based on provided minimum and maximum backoffs. (See Exponential backoff.)

Retry Policy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message.

Retry Policy is implemented on a best effort basis. At times, the delay between consecutive deliveries may not match the configuration. That is, delay can be more or less than configured backoff.

Inherits

  • Object

Example

require "google/cloud/pubsub"

pubsub = Google::Cloud::PubSub.new

sub = pubsub.subscription "my-topic-sub"

sub.retry_policy = Google::Cloud::PubSub::RetryPolicy.new minimum_backoff: 5, maximum_backoff: 300

sub.retry_policy.minimum_backoff #=> 5
sub.retry_policy.maximum_backoff #=> 300

Methods

#initialize

def initialize(minimum_backoff: nil, maximum_backoff: nil) -> RetryPolicy

Creates a new, immutable RetryPolicy value object.

Returns

#maximum_backoff

def maximum_backoff() -> Numeric

The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. The default value is 600 seconds.

Returns
  • (Numeric) — the current value of maximum_backoff

#maximum_backoff=

def maximum_backoff=(value) -> Numeric

The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. The default value is 600 seconds.

Parameter
  • value (Numeric) — the newly set value
Returns
  • (Numeric) — the newly set value

#minimum_backoff

def minimum_backoff() -> Numeric

The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. The default value is 10 seconds.

Returns
  • (Numeric) — the current value of minimum_backoff

#minimum_backoff=

def minimum_backoff=(value) -> Numeric

The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. The default value is 10 seconds.

Parameter
  • value (Numeric) — the newly set value
Returns
  • (Numeric) — the newly set value