An enterprise application stores user profile updates in an Azure Cosmos DB container named Profiles. You need to implement two separate microservices using the .NET SDK v3: one to update a search index, and another to send welcome emails. Both microservices must process all change feed notifications from the Profiles container independently. You plan to use a single shared container named leases to store the lease state.
Which two of the following configuration steps must you perform to ensure both microservices process all changes?
- Configure each microservice's change feed processor with a unique processor name using the WithProcessorName method.Cevap
- Configure both change feed processors to point to the leases container as their lease container.Cevap
- CConfigure the leases container with a partition key of /userId to match the partition key of the monitored Profiles container.
- DConfigure both microservices to use the same processor name in the WithProcessorName method to enable parallel execution.
Cevap
Configure each microservice's change feed processor with a unique processor name using the WithProcessorName method, and configure both change feed processors to point to the leases container as their lease container.
To process change feed notifications independently for multiple distinct business requirements, each microservice must represent a separate logical consumer group. In the Azure Cosmos DB .NET SDK v3, this is achieved by assigning a unique processor name to each Change Feed Processor instance via the WithProcessorName method. When sharing a single lease container, the unique processor name acts as a prefix key namespace, allowing both microservices to store and manage their leases in the same container without interfering with each other.
Adım Adım Çözüm
Anahtar Kavram
Azure Cosmos DB Change Feed Processor Multi-Consumer Configuration