Skip to content

Commit 6e01b31

Browse files
committed
Addressing review comments.
1 parent 49958dc commit 6e01b31

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

articles/cosmos-db/nosql/change-feed-processor.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ Afterward, you define the compute instance name or unique identifier by using `W
7474
Calling `Build` gives you the processor instance that you can start by calling `StartAsync`.
7575

7676
> [!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.
7887
>
7988
> **✅ Do this - Use global endpoint with ApplicationRegion:**
8089
>
@@ -222,7 +231,16 @@ In either change feed mode, you can assign it to `changeFeedProcessorInstance` a
222231
[!code-java[](~/azure-cosmos-java-sql-api-samples/src/main/java/com/azure/cosmos/examples/changefeed/SampleChangeFeedProcessor.java?name=StartChangeFeedProcessor)]
223232
224233
> [!IMPORTANT]
225-
> **Avoid using regional endpoints for CosmosAyncClient backing the feed and lease container**: When building the `CosmosAsyncClient` 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 `preferredRegions` 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.
234+
> When creating the `CosmosAsyncClient` for both the feed and lease containers, and initializing a new change feed processor workload:
235+
>
236+
> **Use a global endpoint**
237+
>
238+
> - Always specify a global endpoint (for example, `contoso.documents.azure.com`) rather than a regional endpoint (for example, `contoso-westus.documents.azure.com`).
239+
>
240+
> **Switch regions using preferredRegions**
241+
>
242+
> - To redirect change feed traffic between regions, rely on the `preferredRegions` property.
243+
> - 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.
226244
>
227245
> **✅ Do this - Use global endpoint with preferredRegions:**
228246
>

0 commit comments

Comments
 (0)