gnodet-bot commented on code in PR #30763:
URL: https://github.com/apache/camel/pull/30763#discussion_r4689134785


##########
components/camel-mongodb/src/main/docs/mongodb-component.adoc:
##########
@@ -1340,6 +1340,18 @@ 
from("mongodb:myDb?consumerType=changeStreams&database=flights&collection=ticket
 
 You can use only endpoint options, only route-level resumable configuration, 
or both depending on your deployment requirements.
 
+While no change of the collection arrives, the change stream still reads the 
oplog, which the other collections of the
+replica set write. The consumer then takes the post batch resume token of the 
change stream, the position up to which
+it has read the oplog, after each getMore that returns no change (MongoDB 
waits up to one second for a change), as the
+token that a new change stream resumes after, and stores it in the 
`changeStreamTokenRepository`. It does so only when
+the exchange of the last change it read completed, so a change whose exchange 
failed is still read again by a new
+change stream, unless a later change completed (as before, the token of that 
change already passes the failed one).
+The token is not passed to a resume strategy, which only gets the tokens of 
the exchanges.

Review Comment:
   📝 **Doc clarity (low):** This paragraph packs several distinct points into a 
dense 7-line block. Consider splitting for readability:
   
   1. **Long sentence (lines 1343-1348):** The first sentence is 68 words. It 
describes three distinct things: what the consumer does (reads PBRT), when it 
stores it (after empty getMores where the last exchange completed), and the 
exception (a later change's token already passes the failed one). Consider 
splitting into two sentences — one for the PBRT reading, one for the storage 
condition.
   
   2. **"as before" aside:** `"unless a later change completed (as before, the 
token of that change already passes the failed one)"` — the parenthetical "as 
before" references prior behavior readers may not know. This could be its own 
sentence: `"If a later change whose exchange completed has already committed a 
token that passes the failed one, the failed change is not reread."` 
   
   3. **"The token is not passed to a resume strategy":** The abrupt negative 
statement may confuse readers. A brief rationale helps: e.g., `"The post batch 
resume token is not passed to a resume strategy (which only receives the tokens 
of completed exchanges), because it is not tied to an exchange."`
   
   Suggested replacement for the paragraph:
   
   ```suggestion
   While no change of the collection arrives, the change stream reads the oplog 
that the other collections of the
   replica set write. After each getMore that returns no change (the server 
waits up to one second), the consumer
   takes the post batch resume token of the change stream — the position up to 
which it has read the oplog — and
   stores it in the `changeStreamTokenRepository`. It does so only when the 
exchange of the last change it read
   completed. A change whose exchange failed is read again by a new change 
stream, unless a later change whose
   exchange completed has already advanced the token past it. The post batch 
resume token is not passed to a
   resume strategy; the strategy only receives the tokens of completed 
exchanges.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to