-
Type: Task
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: API
Hi,
I'm using change streams to gather statistics about my operations (need to take some info from each insert/update) - so I need it to act as a listener without closing.
I inserted 1,000,000 documents into a collection and on the change stream side I am using the start_at_operation_time() option to gather all the required info.
I noticed that the change stream closes randomly before all 1M objects are viewed (using a counter in the loop).
Also, I noticed that when I configure the max_await_time() to 5000 ms then it works fine and all documents are captured before it closes.
The behavior I need is to have the change-stream as a listener that waits for changes all the time.
Is there a way to have this loop blocking? meaning that it will always wait for the next incoming change without exiting the loop.
I saw that someone once issued a "bug" about it, but this is the behavior I want to implement:
From some POCs that I made with Golang and python driver, it looks like they are always blocking and waiting for the next change.
mongocxx driver version: 3.6.6
mongoc driver version: 1.20.1
- related to
-
CXX-2441 Add example of iterating change stream indefinitely
- Closed