Created
September 3, 2021 15:03
-
-
Save mseemann/9be889af256a37952dec0b185a3c9279 to your computer and use it in GitHub Desktop.
MongoStats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query tailQ = new Query().addCriteria(Criteria.where("ns").is("streams.user")); | |
reactiveMongoTemplate.tail(tailQ, OplogEntry.class, "oplog.rs") | |
.retryWhen(Retry.indefinitely().doAfterRetryAsync(signal -> Mono.delay(Duration.ofSeconds(10)).then())) | |
.subscribe(entry -> { | |
log.info("tailed entry: {}", entry); | |
lastOplogAt.set(entry.ts().getTime() * 1000L); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment