-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: API, Connection Management
-
None
Summary
Deprecate Stream-related API, for removal in 5.0 :
- MongoClientSettings.Builder#streamFactoryFactory
- MongoClientSettings.getStreamFactoryFactory
- NettyStreamFactoryFactory
- NettyStreamFactory
- AsynchronousSocketChannelStreamFactory
- AsynchronousSocketChannelStreamFactoryFactory
- BufferProvider
- SocketStreamFactory
- Stream
- StreamFactory
- StreamFactoryFactory
- TlsChannelStreamFactoryFactory
Provide a replacement for com.mongodb.connection.netty.NettyStreamFactoryFactory that supports configuration of Netty, including
- io.netty.buffer.ByteBufAllocator
- io.netty.channel.EventLoopGroup
- Class<? extends SocketChannel>
- io.netty.handler.ssl.SslContext
Note: this same configuration will be required for gRPC support, so consider that in API design.
Motivation
Exposing this large an API surface was a mistake, as in practice the most common thing it was used for was to configure Netty as the transport implementation. By deprecating these types and providing an alternative way to configure Netty with a simpler Settings-style API, we can simplify the API and make it possible to evolve the driver more easily once these deprecated types are removed.