Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5051

Deprecate Stream API

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.11.0
    • Affects Version/s: None
    • Component/s: API, Connection Management
    • None
    • Minor Change
    • Needed
    • Hide

      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

      Show
      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

      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.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: