Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idgoogle.pubsublite.subscriptions

Fields

NameDatatypeDescription
column_anonstring

Methods

NameAccessible byRequired ParamsDescription
admin_projects_locations_subscriptions_getSELECTlocationsId, projectsId, subscriptionsIdReturns the subscription configuration.
admin_projects_locations_subscriptions_listSELECTlocationsId, projectsIdReturns the list of subscriptions for the given project.
admin_projects_locations_topics_subscriptions_listSELECTlocationsId, projectsId, topicsIdLists the subscriptions attached to the specified topic.
admin_projects_locations_subscriptions_createINSERTlocationsId, projectsIdCreates a new subscription.
admin_projects_locations_subscriptions_deleteDELETElocationsId, projectsId, subscriptionsIdDeletes the specified subscription.
admin_projects_locations_subscriptions_patchUPDATElocationsId, projectsId, subscriptionsIdUpdates properties of the specified subscription.
admin_projects_locations_subscriptions_seekEXEClocationsId, projectsId, 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_cursorEXEClocationsId, projectsId, subscriptionsIdUpdates the committed cursor.

SELECT examples

Returns the list of subscriptions for the given project.

SELECT
column_anon
FROM google.pubsublite.subscriptions
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new subscriptions resource.

/*+ create */
INSERT INTO google.pubsublite.subscriptions (
locationsId,
projectsId,
name,
topic,
deliveryConfig,
exportConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ topic }}',
'{{ deliveryConfig }}',
'{{ exportConfig }}'
;

UPDATE example

Updates a subscriptions resource.

/*+ update */
UPDATE google.pubsublite.subscriptions
SET
name = '{{ name }}',
topic = '{{ topic }}',
deliveryConfig = '{{ deliveryConfig }}',
exportConfig = '{{ exportConfig }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND subscriptionsId = '{{ subscriptionsId }}';

DELETE example

Deletes the specified subscriptions resource.

/*+ delete */
DELETE FROM google.pubsublite.subscriptions
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND subscriptionsId = '{{ subscriptionsId }}';