Use of LeaseVersion configuration in ChangeFeedProcessorBuilder

42 Views Asked by At

In Cosmos changefeed, we can pass "LeaseVersion" configuration in "ChangeFeedProcessorBuilder" class.

Default value is PARTITION_KEY_BASED_LEASE.

What is use of LeaseVersion EPK_RANGE_BASED_LEASE ?

version : azure-cosmos-4.47.0

1

There are 1 best solutions below

0
Matias Quaranta On

Looking at the ChangeFeedProcessorBuilder, LeaseVersion seems to be private:

private LeaseVersion leaseVersion = LeaseVersion.PARTITION_KEY_BASED_LEASE;

This is set to EPK_RANGE_BASED_LEASE when using handleLatestVersionChanges or handleAllVersionsAndDeletesChanges (in BETA, this is the Change Feed "All Versions and Deletes" preview mode).