[CXX-993] autoreconnection feature Created: 17/Aug/16  Updated: 11/Sep/19  Resolved: 17/Aug/16

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: 3.0.1
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Andrey Kolkov Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

gcc-5.4, ubuntu 16_04 x64



 Description   

The legacy driver has feature in class mongo::DBClientConnection for autoreconnecting to server. It available via constructor parameter: mongo::DBClientConnection(bool _autoReconnect, ...).
This feature avaliable with the C++11 driver or not (mongocxx::client class hasn't a similar options)?
How I can realize this manually?



 Comments   
Comment by David Golden [ 17/Aug/16 ]

Because the C++11 driver wraps libmongoc, this happens automatically, which is standard for all "next generation" drivers. It will be more efficient using mongocxx::pool to get your clients as that uses a background thread to monitor replica set status.

You can read more about how and why in these articles:

Generated at Wed Feb 07 22:01:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.