5

I'm working with a Spring Boot app. I'm trying to implement callback-based event notification for collection modifications in a MongoDB. I'm running out of ideas, as I have tried the following:

  • Classic Polling - Redundant, as the existing implementation is a REST endpoint that's polled by the UI, where it queries data.

  • Tailable Cursors - Requires a collection to be capped, which is likely a limitation that won't suffice for a database with a very high storage forecast.

  • Change Streams - I got a runtime exception stating that the storage engine doesn't support 'Majority Read Concern'. collection.watch(asList(Aggregates.match(Filters.in("operationType", asList("insert", "update"))))).forEach(printBlock);

I'm not authorizated to view the engine configuration, but I'm assuming if the DBA can't change the storage engine to wiredTiger, than I can't use change streams. Is this correct? Are there other solutions? How about spring's mongodb-reactive API? I was under the impression the API still depends on tailable cursors or change streams.

blackcompe
  • 3,180
  • 16
  • 27

0 Answers0