Soru

Zorluk: OrtaProcess Azure Cosmos DB Change Feed Notifications

You are developing a .NET background service using the Azure Cosmos DB .NET SDK v3. The service uses the Change Feed Processor to monitor product catalog updates in a source container and synchronize them to an Azure Cognitive Search index. You need to provision a new lease container in Azure Cosmos DB to store the state of the Change Feed Processor. Which partition key path must you define when creating the lease container to ensure the Change Feed Processor can initialize and run?

  1. A
    /leaseId
  2. B
    /productId (or matching the partition key of the monitored catalog container)
  3. /idCevap
  4. D
    /partitionKey

Cevap

The lease container must be created with the partition key path set to /id.
The correct answer is to use the /id partition key path. In the Azure Cosmos DB .NET SDK v3, the Change Feed Processor relies on a lease container partitioned specifically by /id. This layout allows the processor to acquire, renew, and distribute leases for different partition key ranges of the monitored container to one or more processing hosts.

Adım Adım Çözüm

1
Determine the role of the lease container in the Cosmos DB Change Feed Processor architecture.
The lease container acts as a state storage mechanism that coordinates processing of the change feed across multiple consumer instances.
This helps identify if there are specific SDK-level structural requirements for this helper container.
2
Verify the partitioning requirement for the lease container under the .NET SDK v3.
The SDK v3 Change Feed Processor implementation expects the lease container to be partitioned by the /id path.
Choosing any other partition key path will cause the GetChangeFeedProcessorBuilder to throw an initialization exception.

Anahtar Kavram

Lease container partition key requirements for the Azure Cosmos DB Change Feed Processor
Bu soruyu puanla