Mongodb java driver recently added (in version 2.12) the following methods to MongoClientOptions.Builder
class:
heartbeatConnectRetryFrequency(int heartbeatConnectRetryFrequency)
heartbeatConnectTimeout(int heartbeatConnectTimeout)
heartbeatFrequency(int heartbeatFrequency)
heartbeatThreadCount(int heartbeatThreadCount)
As per this bug, it looks like these methods expose properties using which the MongoDB Java driver will try to regenerate connection pool, in case the connections in the driver connection pool are dead due to network outage or mongodb-server restart.
I have already read the concerned javadocs and searched on web, but could not find any detailed example or good article explaining how to use them.
Does anyone here know how to use these properties?
The description of these fields is given in javadoc for MongoClientOptions as follows:
heartbeatConnectRetryFrequency(int heartbeatConnectRetryFrequency)
:
heartbeatConnectTimeout(int heartbeatConnectTimeout)
:
heartbeatFrequency(int heartbeatFrequency)
:
heartbeatThreadCount(int heartbeatThreadCount)
:
Some observations I made