[JAVA-5051] Deprecate Stream API Created: 03/Jul/23  Updated: 28/Oct/23  Resolved: 14/Sep/23

Status: Closed
Project: Java Driver
Component/s: API, Connection Management
Affects Version/s: None
Fix Version/s: 4.11.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Duplicate
is duplicated by JAVA-5102 Deprecate SocketStreamFactory constru... Closed
Related
is related to JAVA-5161 Remove deprecated Stream-related types Closed
Epic Link: Java Driver 5.0 Pre-Work
Quarter: FY24Q3
Backwards Compatibility: Minor Change
Documentation Changes: Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?

That the indicated types are deprecated for removal in 5.0

2. Would you like the user to see examples of the syntax and/or executable code and its output?

Yes. Since the most likely scenario for anyone using the deprecated types is for Netty, show how to convert use of NettyStreamFactoryFactory to NettyTransportSettings

3. Which versions of the driver/connector does this apply to?

4.11.0


 Description   

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 only 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.



 Comments   
Comment by Githook User [ 14/Sep/23 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Deprecate Stream-related API (#1195)

  • Deprecate Stream-related API

Adds:

  • TransportSettings abstract class
  • NettyTransportSettings subclass of TransportSettings
  • A new method on MongoClientSettings to configure TransportSettings

Deprecates:

  • MongoClientSettings.Builder#streamFactoryFactory
  • MongoClientSettings.getStreamFactoryFactory
  • NettyStreamFactoryFactory
  • NettyStreamFactory
  • AsynchronousSocketChannelStreamFactory
  • AsynchronousSocketChannelStreamFactoryFactory
  • BufferProvider
  • SocketStreamFactory
  • Stream
  • StreamFactory
  • StreamFactoryFactory
  • TlsChannelStreamFactoryFactory

JAVA-5051
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2ed89c9e4f66cdf2800e510ddd87b31f07901eb9

Generated at Thu Feb 08 09:03:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.