Skip to main content

subscriptions

Creates, updates, deletes, gets or lists a subscriptions resource.

Overview

Namesubscriptions
TypeResource
Idgoogle.pubsublite.subscriptions

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
admin_projects_locations_topics_subscriptions_listselectprojectsId, locationsId, topicsIdpageSize, pageTokenLists the subscriptions attached to the specified topic.
admin_projects_locations_subscriptions_getselectprojectsId, locationsId, subscriptionsIdReturns the subscription configuration.
admin_projects_locations_subscriptions_listselectprojectsId, locationsIdpageSize, pageTokenReturns the list of subscriptions for the given project.
admin_projects_locations_subscriptions_createinsertprojectsId, locationsIdsubscriptionId, skipBacklogCreates a new subscription.
admin_projects_locations_subscriptions_patchupdateprojectsId, locationsId, subscriptionsIdupdateMaskUpdates properties of the specified subscription.
admin_projects_locations_subscriptions_deletedeleteprojectsId, locationsId, subscriptionsIdDeletes the specified subscription.
admin_projects_locations_subscriptions_seekexecprojectsId, locationsId, subscriptionsIdPerforms an out-of-band seek for a subscription to a specified target, which may be timestamps or named positions within the message backlog. Seek translates these targets to cursors for each partition and orchestrates subscribers to start consuming messages from these seek cursors. If an operation is returned, the seek has been registered and subscribers will eventually receive messages from the seek cursors (i.e. eventual consistency), as long as they are using a minimum supported client library version and not a system that tracks cursors independently of Pub/Sub Lite (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for unsupported clients. If clients would like to know when subscribers react to the seek (or not), they can poll the operation. The seek operation will succeed and complete once subscribers are ready to receive messages from the seek cursors for all partitions of the topic. This means that the seek operation will not complete until all subscribers come online. If the previous seek operation has not yet completed, it will be aborted and the new invocation of seek will supersede it.
cursor_projects_locations_subscriptions_commit_cursorexecprojectsId, locationsId, subscriptionsIdUpdates the committed cursor.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
subscriptionsIdstring
topicsIdstring
pageSizeinteger (int32)
pageTokenstring
skipBacklogboolean
subscriptionIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Lists the subscriptions attached to the specified topic.

SELECT
*
FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND topicsId = '{{ topicsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';

INSERT examples

Creates a new subscription.

INSERT INTO google.pubsublite.subscriptions (
data__name,
data__topic,
data__deliveryConfig,
data__exportConfig,
projectsId,
locationsId,
subscriptionId,
skipBacklog
)
SELECT
'{{ name }}',
'{{ topic }}',
'{{ deliveryConfig }}',
'{{ exportConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ subscriptionId }}',
'{{ skipBacklog }}'
RETURNING
name,
deliveryConfig,
exportConfig,
topic
;

UPDATE examples

Updates properties of the specified subscription.

UPDATE google.pubsublite.subscriptions
SET
data__name = '{{ name }}',
data__topic = '{{ topic }}',
data__deliveryConfig = '{{ deliveryConfig }}',
data__exportConfig = '{{ exportConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND subscriptionsId = '{{ subscriptionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
deliveryConfig,
exportConfig,
topic;

DELETE examples

Deletes the specified subscription.

DELETE FROM google.pubsublite.subscriptions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND subscriptionsId = '{{ subscriptionsId }}' --required;

Lifecycle Methods

Performs an out-of-band seek for a subscription to a specified target, which may be timestamps or named positions within the message backlog. Seek translates these targets to cursors for each partition and orchestrates subscribers to start consuming messages from these seek cursors. If an operation is returned, the seek has been registered and subscribers will eventually receive messages from the seek cursors (i.e. eventual consistency), as long as they are using a minimum supported client library version and not a system that tracks cursors independently of Pub/Sub Lite (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for unsupported clients. If clients would like to know when subscribers react to the seek (or not), they can poll the operation. The seek operation will succeed and complete once subscribers are ready to receive messages from the seek cursors for all partitions of the topic. This means that the seek operation will not complete until all subscribers come online. If the previous seek operation has not yet completed, it will be aborted and the new invocation of seek will supersede it.

EXEC google.pubsublite.subscriptions.admin_projects_locations_subscriptions_seek 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@subscriptionsId='{{ subscriptionsId }}' --required
@@json=
'{
"namedTarget": "{{ namedTarget }}",
"timeTarget": "{{ timeTarget }}"
}';