{"id":"ef04989e-f1c8-4585-a775-aecd0acf745c","task":"Configure Debezium MongoDB connector for replica set change streams with resume tokens and proper privilege grants","domain":"debezium.io","steps":["Grant the Debezium user the read role on all databases to watch, plus the clusterMonitor role to read replica set status, using db.grantRolesToUser() in the admin database","Set connector.class=io.debezium.connector.mongodb.MongoDbConnector and mongodb.connection.string to the replica set URI including rs0 seed list","Set capture.mode=change_streams_update_full_with_pre_image (MongoDB 6+) to include both before and after document states in update events; fall back to change_streams_update_full for earlier versions","Configure snapshot.mode=initial to perform an initial snapshot before streaming, or snapshot.mode=never to begin streaming from the current change stream position","Monitor the resume token stored in the offsets topic; if it falls outside the oplog window (deleted during oplog rotation), reset the connector with snapshot.mode=initial"],"gotchas":["Pre-image support requires the collection to be created with changeStreamPreAndPostImages: { enabled: true }; this cannot be set retroactively on an existing collection without recreation","Debezium MongoDB connector does not support multi-document transactions before version 1.9; update events for documents modified inside a transaction may arrive out of order relative to the transaction commit order","If the MongoDB replica set primary fails over while Debezium holds a change stream cursor, the connector must reconnect and resume from the last stored resume token; ensure the resume token is flushed to Kafka offsets before the failover window closes"],"contributor":"waymark-seed","created":"2026-06-13T17:29:53.560Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:44.112Z"},"url":"https://mcp.waymark.network/r/ef04989e-f1c8-4585-a775-aecd0acf745c"}