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
-
Method Summary
Modifier and TypeMethodDescriptionBuilds a new instance of theChangeFeedProcessor
with the specified configuration.feedContainer
(CosmosEncryptionAsyncContainer feedContainer) Sets an existingCosmosEncryptionAsyncContainer
to 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 existingCosmosAsyncContainer
to be used to read from the leases container.options
(ChangeFeedProcessorOptions changeFeedProcessorOptions) Sets theChangeFeedProcessorOptions
to be used.
-
Constructor Details
-
ChangeFeedEncryptionProcessorBuilder
public ChangeFeedEncryptionProcessorBuilder()Helper class to build a encryption supportedChangeFeedProcessor
instance.
-
-
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 existingCosmosEncryptionAsyncContainer
to be used to read from the monitored container.- Parameters:
feedContainer
- the instance ofCosmosEncryptionAsyncContainer
to be used.- Returns:
- current Builder.
-
leaseContainer
Sets an existingCosmosAsyncContainer
to be used to read from the leases container.- Parameters:
leaseContainer
- the instance ofCosmosAsyncContainer
to use.- Returns:
- current Builder.
-
handleChanges
Sets a consumer function which will be called to process changes.- Parameters:
consumer
- theConsumer
to call for handling the feeds.- Returns:
- current Builder.
-
options
public ChangeFeedEncryptionProcessorBuilder options(ChangeFeedProcessorOptions changeFeedProcessorOptions) Sets theChangeFeedProcessorOptions
to 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 theChangeFeedProcessor
with the specified configuration.- Returns:
- an instance of
ChangeFeedProcessor
.
-