Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Commit 3cfb8ec

Browse files
author
Theo van Kraay
committed
Add change feed processor tags
1 parent a778b2e commit 3cfb8ec

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/com/azure/cosmos/examples/changefeed/SampleChangeFeedProcessor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ public static void main(String[] args) {
7474
//The next line causes the worker to create and start an instance of the Change Feed Processor. See the implementation of getChangeFeedProcessor() for guidance
7575
//on creating a handler for Change Feed events. In this stream, we also trigger the insertion of 10 documents on a separate
7676
//thread.
77+
78+
// <StartChangeFeedProcessor>
7779
logger.info("-->START Change Feed Processor on worker (handles changes asynchronously)");
7880
changeFeedProcessorInstance = getChangeFeedProcessor("SampleHost_1", feedContainer, leaseContainer);
7981
changeFeedProcessorInstance.start()
8082
.subscribeOn(Schedulers.elastic())
8183
.doOnSuccess(aVoid -> {
8284
//pass
85+
8386
})
8487
.subscribe();
88+
// </StartChangeFeedProcessor>
8589

8690
//These two lines model an application which is inserting ten documents into the feed container
8791
logger.info("-->START application that inserts documents into feed container");
@@ -121,6 +125,7 @@ public static void main(String[] args) {
121125
logger.info("END Sample");
122126
}
123127

128+
// <Delegate>
124129
public static ChangeFeedProcessor getChangeFeedProcessor(String hostName, CosmosAsyncContainer feedContainer, CosmosAsyncContainer leaseContainer) {
125130
return new ChangeFeedProcessorBuilder()
126131
.hostName(hostName)
@@ -152,6 +157,7 @@ public static ChangeFeedProcessor getChangeFeedProcessor(String hostName, Cosmos
152157
})
153158
.buildChangeFeedProcessor();
154159
}
160+
// </Delegate>
155161

156162
public static CosmosAsyncClient getCosmosClient() {
157163

0 commit comments

Comments
 (0)