Cloud PubSub V1 Client - Class MessageStoragePolicy (2.5.1)

Reference documentation and code samples for the Cloud PubSub V1 Client class MessageStoragePolicy.

A policy constraining the storage of messages published to the topic.

Generated from protobuf message google.pubsub.v1.MessageStoragePolicy

Namespace

Google \ Cloud \ PubSub \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ allowed_persistence_regions array

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

↳ enforce_in_transit bool

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

getAllowedPersistenceRegions

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setAllowedPersistenceRegions

Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getEnforceInTransit

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

Returns
Type Description
bool

setEnforceInTransit

Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

Parameter
Name Description
var bool
Returns
Type Description
$this