Configuration for number of read/write retry

Hi Mongo Community.

I am a noob in using the official Mongo Scala/Java driver. Right now I am migrating a project that uses Reactivemongo driver from and I am having difficulty how to migrate from there a connection property called FailOverStrategy which sets the count of retry and the length of delay for the retries. I noticed there is only a boolean param for the connection string of the official Mongo Scala/Java driver called readRetry and writeRetry. My question is how to set the number of read/write retry and delay in the official driver?

Thanks in advance.

Depending on the driver version you are using, it’s likely that the driver supports Retryable Reads and Writes by default (both are enabled by default in drivers compatible with MongoDB 4.2+). Note that retryable reads and writes make only one retry attempt.