You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pubsub/MIGRATING.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,13 +36,13 @@ The following is an overview of the migration process. You can find more details
36
36
37
37
## Admin operations
38
38
39
-
The Pub/Sub admin plane is used to manage Pub/Sub resources like topics, subscriptions, and schemas. These admin operations include `Create`, `Get`, `Update`, `List`, and `Delete`.
39
+
The Pub/Sub admin plane is used to manage Pub/Sub resources like topics, subscriptions, and schemas. These admin operations include `Create`, `Get`, `Update`, `List`, and `Delete`. For subscriptions, seek and snapshots are also part of this layer.
40
40
41
41
One of the key differences between the v1 and v2 versions is the change to the admin API. Two new clients called `TopicAdminClient` and `SubscriptionAdminClient` are added that handle the admin operations for topics and subscriptions respectively.
42
42
43
43
For topics and subscriptions, you can access these admin clients as fields of the main client: `pubsub.Client.TopicAdminClient` and `pubsub.Client.SubscriptionAdminClient`. These clients are pre-initialized when calling `pubsub.NewClient`, and takes in the same `ClientOptions` when `NewClient` is called.
44
44
45
-
There is a mostly one-to-one mapping of existing admin methods to the new admin methods.
45
+
There is a mostly one-to-one mapping of existing admin methods to the new admin methods. There are some exceptions that are noted below.
In this case, `MessageTransform_JavascriptUdf` satisfies the interface, while `JavascriptUdf` holds the actual strings relevant for the message transform.
346
346
347
+
### Seek / snapshots
348
+
349
+
Seek and snapshot RPCs are also part of the admin layer. Use the [SubscriptionAdminClient](https://pkg.go.dev/cloud.google.com/go/pubsub/v2/apiv1#SubscriptionAdminClient) to Seek to specific time or snapshot.
In the v2, [pubsub.NewClientWithConfig](https://pkg.go.dev/cloud.google.com/go/pubsub#NewClientWithConfig) is still the correct method to invoke to add RPC specific retries and timeouts. However, the helper struct is renamed from `ClientConfig.PublisherCallOptions` to `TopicAdminCallOptions`. The same is true for Subscription calls, which is now named `SubscriptionAdminCallOptions.`
0 commit comments