Skip to content

Commit 26a857b

Browse files
committed
refresh reading change feed doc
1 parent dd5987b commit 26a857b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

articles/cosmos-db/change-feed-pull-model.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: tisande
66
ms.service: cosmos-db
77
ms.devlang: dotnet
88
ms.topic: conceptual
9-
ms.date: 05/11/2020
9+
ms.date: 05/12/2020
1010
ms.reviewer: sngun
1111
---
1212

@@ -144,6 +144,8 @@ while (iterator.HasMoreResults)
144144
FeedIterator<User> iteratorThatResumesFromLastPoint = container.GetChangeFeedIterator<User>(continuation);
145145
```
146146

147+
As long as the Cosmos container still exists, a FeedIterator's continuation token never expires.
148+
147149
## Comparing with change feed processor
148150

149151
Many scenarios can process the change feed using either the [change feed processor](change-feed-processor.md) or the pull model. The pull model's continuation tokens and the change feed processor's lease container are both "bookmarks" for the last processed item (or batch of items) in the change feed.

articles/cosmos-db/read-change-feed.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: timsander1
55
ms.author: tisande
66
ms.service: cosmos-db
77
ms.topic: conceptual
8-
ms.date: 05/11/2020
8+
ms.date: 05/12/2020
99
ms.reviewer: sngun
1010
---
1111

@@ -34,23 +34,23 @@ Using a push model is the easiest way to read from the change feed. There are tw
3434

3535
### Azure Functions
3636

37-
Azure Functions is the simplest option if you are just getting started using the change feed. Due to its simplicity, it is also the recommended option for most change feed use cases. When you create an Azure Functions trigger for Cosmos DB, you select the container to connect, and the Azure Function gets triggered whenever there is a change to the container. Because Azure Function's uses the change feed processor behind the scenes, it automatically parallelizes change processing across your container's [partitions](partition-data.md).
37+
Azure Functions is the simplest option if you are just getting started using the change feed. Due to its simplicity, it is also the recommended option for most change feed use cases. When you create an Azure Functions trigger for Azure Cosmos DB, you select the container to connect, and the Azure Function gets triggered whenever there is a change to the container. Because Azure Function's uses the change feed processor behind the scenes, it automatically parallelizes change processing across your container's [partitions](partition-data.md).
3838

39-
Developing with Azure Functions is an easy experience and can be faster than deploying the change feed processor on your own. Triggers can be created by using the Azure Functions portal, the Azure Cosmos DB portal or programmatically with SDKs. Visual Studio and VS Code provide support to write Azure Functions, and you can even use the Azure Functions CLI for cross-platform development. You can write and debug the code on your desktop, and then deploy the function with one click. See [Serverless database computing using Azure Functions](serverless-computing-database.md) and [Using change feed with Azure Functions](change-feed-functions.md)) articles to learn more.
39+
Developing with Azure Functions is an easy experience and can be faster than deploying the change feed processor on your own. Triggers can be created by using the Azure Functions portal, the Azure Cosmos DB portal or programmatically with SDKs. Visual Studio and VS Code provide support to write Azure Functions, and you can even use the Azure Functions CLI for cross-platform development. You can write and debug the code on your desktop, and then deploy the function with one click. See [Serverless database computing using Azure Functions](serverless-computing-database.md) and [Using change feed with Azure Functions](change-feed-functions.md) articles to learn more.
4040

4141
### Change feed processor library
4242

4343
The change feed processor gives you more control of the change feed and still hides most complexity. The change feed processor library follows the observer pattern, where your processing function is called by the library. The change feed processor library will automatically check for changes and, if changes are found, "push" these to the client. If you have a high throughput change feed, you can instantiate multiple clients to read the change feed. Because you're using change feed processor library, it will automatically divide the load among the different clients. You won't have to implement any logic for load balancing across multiple clients or any logic to maintain the lease state.
4444

45-
The change feed processor library guarantees an "at-least-once" delivery of all of the changes. In other words, if you use the change feed processor library, your processing function will be called successfully for every item in the change feed. If there is an unhandled exception in the business logic in your processing function, the failed changes will be retried until they are processed successfully. To prevent your change feed processor from getting "stuck" continuously retrying the same changes, you should add logic in your processing function to write documents, upon exception, to a dead-letter queue. Learn more about [Error handling](change-feed-processor.md#error-handling).
45+
The change feed processor library guarantees an "at-least-once" delivery of all of the changes. In other words, if you use the change feed processor library, your processing function will be called successfully for every item in the change feed. If there is an unhandled exception in the business logic in your processing function, the failed changes will be retried until they are processed successfully. To prevent your change feed processor from getting "stuck" continuously retrying the same changes, you should add logic in your processing function to write documents, upon exception, to a dead-letter queue. Learn more about [error handling](change-feed-processor.md#error-handling).
4646

47-
In Azure Functions, the recommendation for handling errors is the same. You should still add logic in your delegate code to write documents, upon exception, to a dead-letter queue. However, if there is an unhandled exception in your Azure Function, the change that generated the exception won't be automatically retried. While Azure Functions is guaranteed to *attempt* to process each change once, it will only handle retries for things like transient network issues or service outages. If there is an unhandled exception in the business logic, the Azure Function will move on to processing the next change. The Azure Function won't retry the same failed change.
47+
In Azure Functions, the recommendation for handling errors is the same. You should still add logic in your delegate code to write documents, upon exception, to a dead-letter queue. However, if there is an unhandled exception in your Azure Function, the change that generated the exception won't be automatically retried. If there is an unhandled exception in the business logic, the Azure Function will move on to processing the next change. The Azure Function won't retry the same failed change.
4848

49-
Like Azure Functions, developing with the change feed processor library is easy. However, you are responsible for deploying one or more hosts for the change feed processor. A host is an application instance that uses the change feed processor to listen for changes. While Azure Functions has capabilities for automatic scaling, you are responsible for scaling your hosts. To learn more, see [using change feed processor](change-feed-processor.md). The change feed processor library is part of the [Azure Cosmos DB SDK V3](https://github.com/Azure/azure-cosmos-dotnet-v3).
49+
Like Azure Functions, developing with the change feed processor library is easy. However, you are responsible for deploying one or more hosts for the change feed processor. A host is an application instance that uses the change feed processor to listen for changes. While Azure Functions has capabilities for automatic scaling, you are responsible for scaling your hosts. To learn more, see [using the change feed processor](change-feed-processor.md#dynamic-scaling). The change feed processor library is part of the [Azure Cosmos DB SDK V3](https://github.com/Azure/azure-cosmos-dotnet-v3).
5050

5151
## Reading change feed with a pull model
5252

53-
The [change feed pull model](change-feed-pull-model.md) allows you to consume the change feed at your own pace. Changes must be requested by the client and there is no automatic polling for changes. If you want to permanently "bookmark" the last processed change (similarly to the push model's lease container), you'll need to [save a continuation token](change-feed-pull-model.md#saving-continuation-tokens).
53+
The [change feed pull model](change-feed-pull-model.md) allows you to consume the change feed at your own pace. Changes must be requested by the client and there is no automatic polling for changes. If you want to permanently "bookmark" the last processed change (similar to the push model's lease container), you'll need to [save a continuation token](change-feed-pull-model.md#saving-continuation-tokens).
5454

5555
Using the change feed pull model, you get more low level control of the change feed. When reading the change feed with the pull model, you have three options:
5656

0 commit comments

Comments
 (0)