Skip to content

Commit 869c538

Browse files
committed
Add note about TXT records to Javadoc of ClusterSettings.Builder#srvHost
JAVA-3573
1 parent 90ec0aa commit 869c538

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
@@ -123,8 +123,17 @@ public Builder applySettings(final ClusterSettings clusterSettings) {
123123
/**
124124
* Sets the host name to use in order to look up an SRV DNS record to find the MongoDB hosts.
125125
*
126+
* <p>
127+
* Note that when setting srvHost via {@code ClusterSettings.Builder}, the driver will NOT process any associated TXT records
128+
* associated with the host. In order to enable the processing of TXT records while still using {@code MongoClientSettings},
129+
* specify the SRV host via connection string and apply the connection string to the settings, e.g.
130+
* {@code MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://host1.acme.com")) }.
131+
* </p>
132+
*
126133
* @param srvHost the SRV host name
127134
* @return this
135+
* @see com.mongodb.MongoClientSettings.Builder#applyConnectionString(ConnectionString)
136+
* @see ClusterSettings.Builder#applyConnectionString(ConnectionString)
128137
*/
129138
public Builder srvHost(final String srvHost) {
130139
if (this.hosts != DEFAULT_HOSTS) {

0 commit comments

Comments
 (0)