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/nosql/change-feed-processor.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,16 @@ Afterward, you define the compute instance name or unique identifier by using `W
74
74
Calling `Build` gives you the processor instance that you can start by calling `StartAsync`.
75
75
76
76
> [!IMPORTANT]
77
-
> **Avoid using regional endpoints for CosmosClient backing the feed and lease container**: When building the `CosmosClient` for the feed and lease container and also using a fresh change feed processor workload, ensure a global endpoint is used (e.g. `contoso.documents.azure.com` and not `contoso-westus.documents.azure.com`). Rely on `ApplicationRegion` or `ApplicationPreferredRegions` when switching change feed traffic from one region to another. Changing the regional endpoint to switch regions could potentially create new lease documents which cause change feed processor to not use any previously stored state. This is because change feed processor creates lease documents which are scoped to the configured endpoint, hence changing the endpoints result in new independent lease documents.
77
+
> When creating the `CosmosClient` for both the feed and lease containers, and initializing a new change feed processor workload:
78
+
>
79
+
> **Use a global endpoint**
80
+
>
81
+
> - Always specify a global endpoint (for example, `contoso.documents.azure.com`) rather than a regional endpoint (for example, `contoso-westus.documents.azure.com`).
82
+
>
83
+
> **Switch regions using ApplicationRegion or ApplicationPreferredRegions**
84
+
>
85
+
> - To redirect change feed traffic between regions, rely on the `ApplicationRegion` or `ApplicationPreferredRegions` property.
86
+
> - Change Feed Processor creates lease documents that are scoped to the configured endpoint, hence changing the endpoints results in the creation of new independent lease documents.
78
87
>
79
88
> **✅ Do this - Use global endpoint with ApplicationRegion:**
80
89
>
@@ -222,7 +231,16 @@ In either change feed mode, you can assign it to `changeFeedProcessorInstance` a
0 commit comments