Skip to content

Commit ede1af5

Browse files
committed
comments
1 parent 42a903f commit ede1af5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/cosmos-db/how-to-migrate-from-change-feed-library.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Migrate from the change feed processor library to the Azure Cosmos DB SDK V3
2+
title: Migrate from the change feed processor library to the Azure Cosmos DB .NET V3 SDK
33
description: Learn how to migrate your application from using the change feed processor library to the Azure Cosmos DB SDK V3
44
author: ealsur
55
ms.service: cosmos-db
@@ -8,29 +8,29 @@ ms.date: 09/16/2019
88
ms.author: maquaran
99
---
1010

11-
# Migrate from the change feed processor library to the Azure Cosmos DB SDK V3
11+
# Migrate from the change feed processor library to the Azure Cosmos DB .NET V3 SDK
1212

13-
This article describes the required steps to migrate an existing application's code that uses the [library](https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet) to consume the [change feed](change-feed.md) to the SDK V3.
13+
This article describes the required steps to migrate an existing application's code that uses the [change feed processor library](https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet) to the [change feed](change-feed.md) feature in the latest version of the .NET SDK (also referred as .NET V3 SDK).
1414

1515
## Required code changes
1616

17-
The SDK V3 includes several breaking changes in the public APIs. The main steps to address during the migration are:
17+
The .NET V3 SDK has several breaking changes, the following are the key steps to migrate your application:
1818

19-
1. Convert `DocumentCollectionInfo` instances into `Container` references for the monitored and leases containers.
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-
1. If specifying `ChangeFeedProcessorOptions.LeasePrefix`, use that same value as the `processorName` on `GetChangeFeedProcessorBuilder`, or use `string.Empty` otherwise.
19+
1. Convert the `DocumentCollectionInfo` instances into `Container` references for the monitored and leases containers.
20+
1. Customizations that use `WithProcessorOptions` should be updated to use `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+
1. Set the `processorName` on `GetChangeFeedProcessorBuilder` to match the value configured on `ChangeFeedProcessorOptions.LeasePrefix`, or use `string.Empty` otherwise.
2222
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). 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.
23+
1. To handle the changes, you no longer need an implementation, instead you need to [define 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.
2424

25-
For example, if the original code is building the change feed processor like this:
25+
For example, if the original code to build the change feed processor looks as follows:
2626

2727
[!code-csharp[Main](~/samples-cosmosdb-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Usage/ChangeFeed/Program.cs?name=ChangeFeedProcessorLibrary)]
2828

29-
The migrated code would look like:
29+
The migrated code will look like:
3030

3131
[!code-csharp[Main](~/samples-cosmosdb-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Usage/ChangeFeed/Program.cs?name=ChangeFeedProcessorMigrated)]
3232

33-
And the delegate, can be simply a static method:
33+
And the delegate, can be a static method:
3434

3535
[!code-csharp[Main](~/samples-cosmosdb-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Usage/ChangeFeed/Program.cs?name=Delegate)]
3636

@@ -43,7 +43,7 @@ The SDK V3 change feed processor will detect any old library state and migrate i
4343
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.
4444

4545
> [!NOTE]
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.
46+
> Migrations from applications using the library to the .NET V3 SEK are one-way, since the state (leases) will be migrated to the new schema. The migration is not backward compatible.
4747
4848

4949
## Additional resources

0 commit comments

Comments
 (0)