Package com.azure.cosmos.encryption
Class ChangeFeedEncryptionProcessorBuilder
java.lang.Object
com.azure.cosmos.encryption.ChangeFeedEncryptionProcessorBuilder
Helper class to build a
ChangeFeedProcessor instance for encryption feed container.
ChangeFeedProcessor changeFeedProcessor = new ChangeFeedProcessorBuilder()
.hostName(hostName)
.feedContainer(feedContainer) // CosmosEncryptionAsyncContainer
.leaseContainer(leaseContainer)
.handleChanges(docs -> {
for (JsonNode item : docs) {
// Implementation for handling and processing of each JsonNode item goes here
}
})
.buildChangeFeedProcessor();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a new instance of theChangeFeedProcessorwith the specified configuration.feedContainer(CosmosEncryptionAsyncContainer feedContainer) Sets an existingCosmosEncryptionAsyncContainerto be used to read from the monitored container.handleChanges(Consumer<List<JsonNode>> consumer) Sets a consumer function which will be called to process changes.Sets the host name.leaseContainer(CosmosAsyncContainer leaseContainer) Sets an existingCosmosAsyncContainerto be used to read from the leases container.options(ChangeFeedProcessorOptions changeFeedProcessorOptions) Sets theChangeFeedProcessorOptionsto be used.
-
Constructor Details
-
ChangeFeedEncryptionProcessorBuilder
public ChangeFeedEncryptionProcessorBuilder()Helper class to build a encryption supportedChangeFeedProcessorinstance.
-
-
Method Details
-
hostName
Sets the host name.- Parameters:
hostName- the name to be used for the host. When using multiple hosts, each host must have a unique name.- Returns:
- current Builder.
-
feedContainer
public ChangeFeedEncryptionProcessorBuilder feedContainer(CosmosEncryptionAsyncContainer feedContainer) Sets an existingCosmosEncryptionAsyncContainerto be used to read from the monitored container.- Parameters:
feedContainer- the instance ofCosmosEncryptionAsyncContainerto be used.- Returns:
- current Builder.
-
leaseContainer
Sets an existingCosmosAsyncContainerto be used to read from the leases container.- Parameters:
leaseContainer- the instance ofCosmosAsyncContainerto use.- Returns:
- current Builder.
-
handleChanges
Sets a consumer function which will be called to process changes.- Parameters:
consumer- theConsumerto call for handling the feeds.- Returns:
- current Builder.
-
options
public ChangeFeedEncryptionProcessorBuilder options(ChangeFeedProcessorOptions changeFeedProcessorOptions) Sets theChangeFeedProcessorOptionsto be used. Unless specifically set the default values that will be used are:- maximum items per page or FeedResponse: 100
- lease renew interval: 17 seconds
- lease acquire interval: 13 seconds
- lease expiration interval: 60 seconds
- feed poll delay: 5 seconds
- maximum scale count: unlimited
- Parameters:
changeFeedProcessorOptions- the change feed processor options to use.- Returns:
- current Builder.
-
buildChangeFeedProcessor
Builds a new instance of theChangeFeedProcessorwith the specified configuration.- Returns:
- an instance of
ChangeFeedProcessor.
-