Class ChangeFeedPolicy
Represents the change feed policy configuration for a container in the Azure Cosmos DB service.
public sealed class ChangeFeedPolicy
- Inheritance
-
ChangeFeedPolicy
- Inherited Members
- Extension Methods
Examples
The example below creates a new container with a custom change feed policy for full fidelity change feed with a retention window of 5 minutes - so intermediary snapshots of changes as well as deleted documents would be available for processing for 5 minutes before they vanish. Processing the change feed with AllVersionsAndDeletes will only be able within this retention window - if you attempt to process a change feed after more than the retention window (5 minutes in this sample) an error (Status Code 400) will be returned. It would still be possible to process changes using Incremental mode even when configuring a full fidelity change feed policy with retention window on the container and when using Incremental mode it doesn't matter whether your are out of the retention window or not.
ContainerProperties containerProperties = new ContainerProperties("MyCollection", "/country");
containerProperties.ChangeFeedPolicy.FullFidelityRetention = TimeSpan.FromMinutes(5);
CosmosContainerResponse containerCreateResponse = await client.GetDatabase("dbName").CreateContainerAsync(containerProperties, 5000);
ContainerProperties createdContainerProperties = containerCreateResponse.Container;
Constructors
ChangeFeedPolicy()
public ChangeFeedPolicy()
Properties
FullFidelityNoRetention
Disables the retention log.
public static TimeSpan FullFidelityNoRetention { get; }
Property Value
FullFidelityRetention
Gets or sets a value that indicates for how long operation logs have to be retained.
public TimeSpan FullFidelityRetention { get; set; }
Property Value
- TimeSpan
Value is in TimeSpan.
Remarks
Minimum granularity supported is minutes.