Skip to content

Commit 4c0a837

Browse files
committed
JAVA-2662: Show example in reference documentation of setting the JMXConnectionPoolListener using the API available in the 3.6 release
1 parent 2feeaa1 commit 4c0a837

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/reference/content/driver-async/reference/monitoring.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ JMX connection pool monitoring is disabled by default. To enable it add a `com.m
3939
```java
4040
MongoClientSettings settings =
4141
MongoClientSettings.builder()
42-
.applyToConnectionPoolSettings(builder -> builder.addConnectionPoolListener(new JMXConnectionPoolListener()))
43-
.build();
42+
.connectionPoolSettings(ConnectionPoolSettings.builder()
43+
.addConnectionPoolListener(new JMXConnectionPoolListener())
44+
.build())
45+
.build();
4446
```
4547

4648
# Command Monitoring

0 commit comments

Comments
 (0)