ChangeFeedPolicy Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the change feed policy configuration for a container in the Azure Cosmos DB service.
public sealed class ChangeFeedPolicy
type ChangeFeedPolicy = class
Public NotInheritable Class ChangeFeedPolicy
- Inheritance
-
ChangeFeedPolicy
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
| Name | Description |
|---|---|
| ChangeFeedPolicy() | |
Properties
| Name | Description |
|---|---|
| FullFidelityNoRetention |
Disables the retention log. |
| FullFidelityRetention |
Gets or sets a value that indicates for how long operation logs have to be retained. |