Skip to content

Commit 95b27cf

Browse files
committed
Add note about TXT records to Javadoc of ClusterSettings.Builder#srvHost
JAVA-3573
1 parent ff55404 commit 95b27cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

driver-core/src/main/com/mongodb/connection/ClusterSettings.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,17 @@ public Builder description(final String description) {
142142
/**
143143
* Sets the host name to use in order to look up an SRV DNS record to find the MongoDB hosts.
144144
*
145+
* <p>
146+
* Note that when setting srvHost via {@code ClusterSettings.Builder}, the driver will NOT process any associated TXT records
147+
* associated with the host. In order to enable the processing of TXT records while still using {@code MongoClientSettings},
148+
* specify the SRV host via connection string and apply the connection string to the settings, e.g.
149+
* {@code MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://host1.acme.com")) }.
150+
* </p>
151+
*
145152
* @param srvHost the SRV host name
146153
* @return this
154+
* @see com.mongodb.MongoClientSettings.Builder#applyConnectionString(ConnectionString)
155+
* @see ClusterSettings.Builder#applyConnectionString(ConnectionString)
147156
*/
148157
public Builder srvHost(final String srvHost) {
149158
if (this.hosts != DEFAULT_HOSTS) {

0 commit comments

Comments
 (0)