Poco::MongoDB::ReplicaSet

struct Config

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/ReplicaSet.h

Description

Replica set configuration

Variables

1 }

unsigned int serverReconnectDelaySeconds { 1 };

Topology monitoring interval in seconds (default: 10) Number of connection retries to a server/replica set if no server is available temporarily Delay in seconds between re-connects to a server/replica set if no server is available temporarily

10 }

unsigned int connectTimeoutSeconds { 10 };

Default read preference for this replica set. Connection timeout in seconds (default: 10).

Applied when connecting to MongoDB servers during topology monitoring and when creating connections via getConnection()/getPrimaryConnection()/ getSecondaryConnection(). When using a custom SocketFactory, the factory is responsible for applying its own connect timeout.

30 }

unsigned int socketTimeoutSeconds { 30 };

Socket send/receive timeout in seconds (default: 30).

Applied as the send and receive timeout on sockets after successful connection. This affects how long sendRequest()/readResponse() will wait before timing out. When using a custom SocketFactory, the factory is responsible for applying its own socket timeout.

nullptr }

Connection::SocketFactory * socketFactory { nullptr };

Optional socket factory for SSL/TLS connections. Can be set via config or later using setSocketFactory(). Custom factories can access timeout config via ReplicaSet::configuration().

seeds

std::vector < Net::SocketAddress > seeds;

Seed servers for initial topology discovery. At least one seed must be reachable.

setName

std::string setName;

Expected replica set name. If empty, will be discovered from servers.

true }

bool enableMonitoring { true };

Enable background topology monitoring (default: true)