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: articles/cosmos-db/how-to-migrate-from-change-feed-library.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The SDK V3 includes several breaking changes in the public APIs. The main steps
20
20
1. Customizations that were using `WithProcessorOptions` should be using `WithLeaseConfiguration` and `WithPollInterval` for intervals, `WithStartTime`[for start time](how-to-configure-change-feed-start-time.md), and `WithMaxItems` to define the maximum item count.
21
21
1. If specifying `ChangeFeedProcessorOptions.LeasePrefix`, use that same value as the `processorName` on `GetChangeFeedProcessorBuilder`, or use `string.Empty` otherwise.
22
22
1. The changes are no longer delivered as a `IReadOnlyList<Document>`, instead, it's a `IReadOnlyCollection<T>` where `T` is a type you need to define, there is no base item class anymore.
23
-
1. To handle the changes, you no longer need an Observer implementation, [just a delegate](change-feed-processor.md#implementing-the-change-feed-processor). This delegate can be a simple static Function or, if you need to maintain state across executions, you can create your own class and pass an instance method as delegate.
23
+
1. To handle the changes, you no longer need an Observer implementation, [just a delegate](change-feed-processor.md#implementing-the-change-feed-processor). The delegate can be a static Function or, if you need to maintain state across executions, you can create your own class and pass an instance method as delegate.
24
24
25
25
For example, if the original code is building the change feed processor like this:
26
26
@@ -36,9 +36,11 @@ And the delegate, can be simply a static method:
36
36
37
37
## State and lease container
38
38
39
-
The change feed processor uses a [lease container](change-feed-processor.md#components-of-the-change-feed-processor) to store state, and this is also valid for the library.
39
+
The change feed processor uses a [lease container](change-feed-processor.md#components-of-the-change-feed-processor) to store state, like the library, but the schemas are different.
40
40
41
-
The state created by the library (the lease documents) has a different schema than the SDK V3 but it will be **migrated automatically** upon the first execution of the migrated application code. This means that you can safely stop the application using the old code, migrate the code to the new version, start the migrated application, and any changes that happened while the application was stopped, will be picked up and processed by the new version.
41
+
The SDK V3 change feed processor will detect any old library state and migrate it to the new schema automatically upon the first execution of the migrated application code.
42
+
43
+
You can safely stop the application using the old code, migrate the code to the new version, start the migrated application, and any changes that happened while the application was stopped, will be picked up and processed by the new version.
42
44
43
45
> [!NOTE]
44
46
> Migrations from applications using the library to the SDK V3 are one-way, since the state (leases) will be migrated to the new schema that is not backward compatible.
0 commit comments