Skill 2.1.4

Implement a change feed processor to detect and handle new or updated items

Key Concepts

The change feed is a persistent record of changes, in order within each partition key. In the default latest version mode it contains inserts and updates but not deletes, and shows only the latest version of an item that changed several times. The change feed processor library divides the work into leases, one per partition range, stores them in a lease container, and calls a delegate with each batch. Instances that share a processor name and lease container share the leases, and a failed batch is retried, which gives at-least-once delivery.

The processor library is part of the .NET and Java SDKs. Python applications consume the change feed through the Azure Functions Cosmos DB trigger, which runs the processor for them with a lease container, or through the pull model, in which query_items_change_feed returns changes and a continuation token that the application stores. Handlers must be idempotent, because a batch can be delivered again.