Skip to content

Commit e727a69

Browse files
author
Chris Cho
authored
DOCSP-33227 whats new v4.11 (#131)
* DOCSP-33227: What's new v4.11
1 parent 84132ed commit e727a69

File tree

4 files changed

+136
-6
lines changed

4 files changed

+136
-6
lines changed

snooty.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ zstdVersion = "com.github.luben:zstd-jni:1.5.5-2"
3434
logbackVersion = "1.2.11"
3535
log4j2Version = "2.17.1"
3636
serializationVersion = "1.5.1"
37-
bsonVersion = "4.11.0"

source/fundamentals/data-formats/serialization.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ to your project:
6767
:caption: build.gradle.kts
6868

6969
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:{+serializationVersion+}")
70-
implementation("org.mongodb:bson-kotlinx:{+bsonVersion+}")
70+
implementation("org.mongodb:bson-kotlinx:{+full-version+}")
7171

7272
.. tab::
7373
:tabid: Maven
@@ -86,7 +86,7 @@ to your project:
8686
<dependency>
8787
<groupId>org.mongodb</groupId>
8888
<artifactId>bson-kotlinx</artifactId>
89-
<version>{+bsonVersion+}</version>
89+
<version>{+full-version+}</version>
9090
</dependency>
9191

9292
Annotate Data Classes
@@ -184,4 +184,4 @@ see the following API Documentation:
184184
- `KotlinSerializerCodec <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/index.html>`__
185185
- `KotlinSerializerCodec.create() <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/-companion/create.html>`__
186186
- `BsonConfiguration <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-configuration/index.html>`__
187-
187+

source/includes/language-compatibility-table-kotlin.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99

1010
* - 4.11
1111
- ✓
12+
1213
* - 4.10
1314
- ✓

source/whats-new.txt

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,137 @@ Learn what's new in:
1919
Upcoming Breaking Changes
2020
-------------------------
2121

22-
- Beginning with v5.0, the Kotlin Driver will require Java 11 or later.
22+
- Beginning with v5.0, the {+driver-short+} requires Java 11 or later.
23+
24+
.. _version-4.11:
25+
26+
What's New in 4.11
27+
------------------
28+
29+
This section includes the following information:
30+
31+
- :ref:`kotlin-deprecations-4.11`
32+
- :ref:`kotlin-new-features-4.11`
33+
34+
.. _kotlin-deprecations-4.11:
35+
36+
Deprecations in 4.11
37+
~~~~~~~~~~~~~~~~~~~~
38+
39+
.. warning:: Deprecations in this release
40+
41+
To avoid breaking changes in future major releases of the driver,
42+
replace any application code that depends on deprecated methods and types.
43+
44+
The 4.11 driver release deprecates the following items:
45+
46+
- The following network address-related methods are deprecated and will be removed
47+
in v5.0:
48+
49+
- The `ServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerAddress.html>`__
50+
methods ``getSocketAddress()`` and ``getSocketAddresses()``.
51+
52+
Instead of ``getSocketAddress()``, use the ``getByName()`` instance
53+
method of ``java.net.InetAddress``.
54+
55+
Instead of ``getSocketAddresses()``, use the ``getAllByName()`` instance
56+
method of ``java.net.InetAddress``.
57+
58+
- The `UnixServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/UnixServerAddress.html>`__
59+
method ``getUnixSocketAddress()``.
60+
61+
Instead of ``getUnixSocketAddress()``, construct an instance of
62+
``jnr.unixsocket.UnixSocketAddress``. Pass the full path of the UNIX
63+
socket file to the constructor. By default, MongoDB creates a UNIX
64+
socket file located at ``"/tmp/mongodb-27017.sock"``. To learn more
65+
about the ``UnixSocketAddress``, see the `UnixSocketAddress <https://www.javadoc.io/doc/com.github.jnr/jnr-unixsocket/latest/jnr/unixsocket/UnixSocketAddress.html>`__ API documentation.
66+
67+
- The following methods and types related to the
68+
`StreamFactory <https://mongodb.github.io/mongo-java-driver/4.10/apidocs/mongodb-driver-core/com/mongodb/connection/StreamFactory.html>`__
69+
interface are deprecated and scheduled for removal in v5.0:
70+
71+
- ``streamFactoryFactory()`` method from ``MongoClientSettings.Builder``
72+
- ``getStreamFactoryFactory()`` method from ``MongoClientSettings``
73+
- ``NettyStreamFactoryFactory`` class
74+
- ``NettyStreamFactory`` class
75+
- ``AsynchronousSocketChannelStreamFactory`` class
76+
- ``AsynchronousSocketChannelStreamFactoryFactory`` class
77+
- ``BufferProvider`` class
78+
- ``SocketStreamFactory`` class
79+
- ``Stream`` class
80+
- ``StreamFactory`` class
81+
- ``StreamFactoryFactory`` class
82+
- ``TlsChannelStreamFactoryFactory`` class
83+
84+
If you configure Netty by using
85+
``MongoClientSettings.Builder.streamFactoryFactory()``, your code might resemble
86+
the following:
87+
88+
.. code-block:: java
89+
:emphasize-lines: 6
90+
:copyable: false
91+
92+
import com.mongodb.connection.netty.NettyStreamFactoryFactory;
93+
94+
// ...
95+
96+
MongoClientSettings settings = MongoClientSettings.builder()
97+
.streamFactoryFactory(NettyStreamFactoryFactory.builder().build())
98+
.build();
99+
100+
Replace this code with the `TransportSettings.nettyBuilder() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/TransportSettings.html>`__
101+
as shown in the following example:
102+
103+
.. code-block:: java
104+
:emphasize-lines: 6
105+
106+
import com.mongodb.connection.TransportSettings;
107+
108+
// ...
109+
110+
MongoClientSettings settings = MongoClientSettings.builder()
111+
.transportSettings(TransportSettings.nettyBuilder().build())
112+
.build();
113+
114+
115+
.. _kotlin-new-features-4.11:
116+
117+
New Features in 4.11
118+
~~~~~~~~~~~~~~~~~~~~
119+
120+
New features of the 4.11 driver release include:
121+
122+
- Support for connecting to MongoDB by using a SOCKS5 proxy.
123+
- Added the ``getSplitEvent()`` method to the ``ChangeStreamDocument`` class
124+
to identify fragments of a change stream event that exceeds 16MB. You must
125+
use the aggregation stage ``$changeStreamSplitLargeEvent`` in your change
126+
stream to handle events that exceed 16MB.
127+
- Added an aggregation stage builder for ``$vectorSearch``.
128+
- Added Atlas Search index management helpers.
129+
- Updated Snappy and Zstd compression library dependency versions. To learn
130+
more about the current dependency versions, see :ref:`network-compression`.
131+
- Added ``getElapsedTime()`` methods to the following classes to monitor the
132+
duration of connection pool events:
133+
134+
- `ConnectionCheckOutFailedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckOutFailedEvent.html>`__
135+
- `ConnectionCheckedOutEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckedOutEvent.html>`__
136+
- `ConnectionReadyEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionReadyEvent.html>`__
137+
138+
- Support for Java 21 virtual threads and structured concurrency. The driver
139+
internals were updated to avoid unnecessary pinning of virtual threads
140+
and to preserve interrupted status of a thread, as the latter matters for
141+
structured concurrency where it is used for cancellation.
142+
143+
To learn more about virtual threads, see the `Virtual Threads <https://openjdk.org/jeps/444>`__
144+
JDK enhancement proposal. To learn more about structured concurrency, see the
145+
`Structured Concurrency <https://openjdk.org/jeps/453>`__
146+
JDK enhancement proposal.
147+
148+
- Updated API documentation for the following types:
149+
150+
- `ClusterListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__
151+
- `ServerListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerListener.html>`__
152+
- `ServerMonitorListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerMonitorListener.html>`__
23153

24154
.. _version-4.10:
25155

@@ -29,7 +159,7 @@ What's New in 4.10
29159
.. important::
30160

31161
Starting in version 4.10.1 of the {+driver-short+}, you must add
32-
the ``bson-kotlinx`` library as an explicit dependency to use the
162+
the ``bson-kotlinx`` library as an explicit dependency to use the
33163
``kotlinx-serialization`` library.
34164

35165
- Support for Kotlin server-side usage, both for coroutines and for synchronous applications.

0 commit comments

Comments
 (0)