When watching a change stream on a collection, I can specify a resume Token (with resumeAfter) to get changes after that token in the opslog. What happens, if this token cannot be found in the opslog (for example, the client was disconnected too long and provides an old token)?
Especially, will the async mongodb java driver detect this situation and how?
For me, that question is important because i must detect, whether I lost the connection and have to pull all data again or can rely on the changestream to get all changes from the collection.
The documentation states, that
Change streams are resumable, as long as the oplog has enough history to locate the last operation that the application received.
but does not specify, what happens otherwise. I also find it rather difficult to read the driver source, to determine how a client can detect whether the last token could be found in the opslog.