@@ -89,24 +89,24 @@ struct MemorySize {
8989 */
9090struct ConnectionPolicy {
9191 /* * Number of physical connections opened to each broker. Unset uses the client default. */
92- std::optional<int > connectionsPerBroker;
92+ std::optional<int > connectionsPerBroker = std:: nullopt ;
9393 /* * Maximum time to wait for a TCP/TLS connection to be established, in milliseconds. Unset uses the
9494 * client default. */
95- std::optional<std::chrono::milliseconds> connectionTimeout;
95+ std::optional<std::chrono::milliseconds> connectionTimeout = std:: nullopt ;
9696 /* * Maximum time to wait for a broker request (e.g. produce/consume control ops) to complete, in
9797 * milliseconds. Unset uses the client default. */
98- std::optional<std::chrono::milliseconds> operationTimeout;
98+ std::optional<std::chrono::milliseconds> operationTimeout = std:: nullopt ;
9999 /* * Interval between keep-alive pings sent on an idle connection, in seconds. Unset uses the client
100100 * default. */
101- std::optional<std::chrono::seconds> keepAliveInterval;
101+ std::optional<std::chrono::seconds> keepAliveInterval = std:: nullopt ;
102102 /* * Maximum number of concurrent topic-lookup requests in flight. Unset uses the client default. */
103- std::optional<int > maxLookupRequests;
103+ std::optional<int > maxLookupRequests = std:: nullopt ;
104104 /* * Maximum number of lookup redirects to follow before failing a lookup. Unset uses the client default.
105105 */
106- std::optional<int > maxLookupRedirects;
106+ std::optional<int > maxLookupRedirects = std:: nullopt ;
107107 /* * Time an idle pooled connection may stay open before being closed, in milliseconds. Unset uses the
108108 * client default. */
109- std::optional<std::chrono::milliseconds> maxConnectionIdleTime;
109+ std::optional<std::chrono::milliseconds> maxConnectionIdleTime = std:: nullopt ;
110110};
111111
112112/* *
@@ -118,10 +118,10 @@ struct ConnectionPolicy {
118118 */
119119struct BackoffPolicy {
120120 /* * Delay before the first reconnection attempt, in milliseconds. Unset uses the client default. */
121- std::optional<std::chrono::milliseconds> initialBackoff;
121+ std::optional<std::chrono::milliseconds> initialBackoff = std:: nullopt ;
122122 /* * Upper bound on the backoff delay as it grows across retries, in milliseconds. Unset uses the client
123123 * default. */
124- std::optional<std::chrono::milliseconds> maxBackoff;
124+ std::optional<std::chrono::milliseconds> maxBackoff = std:: nullopt ;
125125};
126126
127127/* *
@@ -136,13 +136,13 @@ struct TlsPolicy {
136136 bool enabled = false ;
137137 /* * Path to the PEM file of trusted CA certificates used to verify the broker. Unset uses the system trust
138138 * store. */
139- std::optional<std::string> trustCertsFilePath;
139+ std::optional<std::string> trustCertsFilePath = std:: nullopt ;
140140 /* * Path to the client certificate PEM file, for mutual TLS. Unset disables client-certificate
141141 * authentication. */
142- std::optional<std::string> certificateFilePath;
142+ std::optional<std::string> certificateFilePath = std:: nullopt ;
143143 /* * Path to the client private key PEM file, for mutual TLS. Unset disables client-certificate
144144 * authentication. */
145- std::optional<std::string> privateKeyFilePath;
145+ std::optional<std::string> privateKeyFilePath = std:: nullopt ;
146146 /* * Whether to accept the broker's certificate without validating it against the trust store. Defaults to
147147 * false (validation enforced). */
148148 bool allowInsecureConnection = false ;
@@ -160,7 +160,7 @@ struct TlsPolicy {
160160struct TransactionPolicy {
161161 /* * Default lifetime of a transaction before it is automatically aborted, in milliseconds. Unset uses the
162162 * client default. */
163- std::optional<std::chrono::milliseconds> timeout;
163+ std::optional<std::chrono::milliseconds> timeout = std:: nullopt ;
164164};
165165
166166} // namespace pulsar::st
0 commit comments