For OGM it comes with the notion of session and retried operations. For Debezium, it has notification APIs https://emptysqua.re/blog/driver-features-for-mongodb-3-6/