Skip to content

Commit bcb63b0

Browse files
authored
DOCSP-34994: socketsettings parameter types fix (#497)
* DOCSP-34994: update to parameter type in socketsettings * add cross link * add taxonomy * ref fix * RM PR fixes * reword * small fixes
1 parent 5ca0532 commit bcb63b0

File tree

4 files changed

+54
-16
lines changed

4 files changed

+54
-16
lines changed

source/fundamentals/connection/mongoclientsettings.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
Specify MongoClient Settings
66
============================
77

8+
.. facet::
9+
:name: genre
10+
:values: reference
11+
12+
.. meta::
13+
:keywords: java sync, customize, connection, code example
14+
815
.. contents:: On this page
916
:local:
1017
:backlinks: none
1118
:depth: 1
1219
:class: singlecol
1320

14-
1521
Overview
1622
--------
1723

@@ -183,7 +189,7 @@ This example demonstrates specifying a ``ConnectionString``:
183189
MongoClient mongoClient = MongoClients.create(
184190
MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://<username>:<password>@<hostname>:<port>/<auth db>?connectTimeoutMS=2000"))
185191
.applyToSocketSettings(builder ->
186-
builder.connectTimeout(5, SECONDS))
192+
builder.connectTimeout(5L, SECONDS))
187193
.build());
188194

189195
Since the driver reads the socket settings options last, the driver
@@ -525,6 +531,8 @@ to modify the driver's behavior:
525531
|
526532
| **Default**: The operating system default
527533

534+
.. _java-socketsettings-example:
535+
528536
Example
529537
~~~~~~~
530538

source/includes/fundamentals/code-snippets/mcs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ private static void createSocketSettings() {
9191
MongoClient mongoClient = MongoClients.create(
9292
MongoClientSettings.builder().applyConnectionString(new ConnectionString("<your connection string>"))
9393
.applyToSocketSettings(builder ->
94-
builder.connectTimeout(10, SECONDS)
95-
.readTimeout(15, SECONDS))
94+
builder.connectTimeout(10L, SECONDS)
95+
.readTimeout(15L, SECONDS))
9696
.build());
9797
//end SocketSettings
9898
mongoClient.listDatabaseNames().forEach(n -> System.out.println(n));

source/upgrade.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
Upgrade Driver Versions
55
=======================
66

7-
.. default-domain:: mongodb
7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: java sync, backwards compatibility, update
813

914
.. contents:: On this page
1015
:local:
1116
:backlinks: none
1217
:depth: 1
1318
:class: singlecol
1419

15-
1620
Overview
1721
--------
1822

@@ -52,6 +56,29 @@ changes between the current and upgrade versions. For example, if you
5256
are upgrading the driver from v4.0 to v4.5, address all breaking changes from
5357
the version after v4.0 including any listed under v4.5.
5458

59+
.. _java-breaking-changes-v5.0:
60+
61+
Version 5.0 Breaking Changes
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63+
64+
- The driver removes the following record annotations:
65+
66+
- ``BsonId``
67+
- ``BsonProperty``
68+
- ``BsonRepresentation``
69+
70+
- You must pass a timeout duration, which is the first parameter, to the
71+
following ``SocketSettings`` builder methods as a ``long`` type:
72+
73+
- ``connectTimeout()``
74+
- ``readTimeout()``
75+
76+
In earlier versions, this parameter is of type ``int`` for both methods. To view an example
77+
that shows how to instantiate a ``SocketSettings`` instance by using
78+
these methods, see the :ref:`SocketSettings Example
79+
<java-socketsettings-example>` in the Specify MongoClient Settings
80+
guide.
81+
5582
.. _java-breaking-changes-v4.8:
5683

5784
Version 4.8 Breaking Changes

source/whats-new.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
What's New
55
==========
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: java sync, backwards compatibility, update, version
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -28,21 +35,17 @@ Learn what's new in:
2835
* :ref:`Version 4.1 <version-4.1>`
2936
* :ref:`Version 4.0 <version-4.0>`
3037

31-
.. _upcoming-breaking-changes:
32-
33-
.. Upcoming Breaking Changes
34-
-------------------------
35-
36-
.. Relocate these items into the source/upgrade.txt page once they become breaking changes
37-
38-
.. In addition to the deprecations mentioned in specific driver versions on this
39-
page, anticipated breaking changes include the following:
40-
4138
.. _version-5.0:
4239

4340
What's New in 5.0
4441
-----------------
4542

43+
.. warning:: Breaking Changes in v5.0
44+
45+
This driver version introduces breaking changes. For a list of these changes, see
46+
the :ref:`Version 5.0 Breaking Changes section <java-breaking-changes-v5.0>` in the
47+
Upgrade guide.
48+
4649
The 5.0 driver release introduces the following features:
4750

4851
- Consistent computation of the ``ClusterConnectionMode`` type after

0 commit comments

Comments
 (0)