This PR implements sub-issue #3551 as part of the artifact modularization effort described in #3470.
The goal of this change is to separate the Netty implementation from the main zio-http artifact so that transport-specific code is modular and can evolve independently.
A new zio-http-netty module has been introduced to host all Netty-based server and client implementations. Previously, these sources lived inside the zio-http/jvm project.
By moving Netty into its own artifact, we reduce coupling between core HTTP abstractions and the Netty transport layer, making the project easier to maintain and extend.
zio-http-netty sbt projectIntroduced a new module:
zio-http-nettyThis module now contains all Netty-related implementations.
All sources under:
zio-http/jvm/src/main/scala/zio/http/netty
were moved to:
zio-http-netty/src/main/scala/zio/http/netty
This includes all Netty server, client, model, and socket related code (25+ files).
New API objects were introduced in the zio.http package to provide access to Netty implementations.
NettyServer
NettyServer.liveNettyServer.customizedNettyServer.defaultNettyServer.defaultWithPort()NettyClient
NettyClient.liveNettyClient.customizedNettyClient.defaultNettyClient.configured()These APIs provide a clear entry point for using the Netty driver while keeping the core module transport-agnostic.
The following platform-specific components were updated:
ServerPlatformSpecificDriverPlatformSpecificZClientPlatformSpecificThese now throw UnsupportedOperationException when used without the Netty module.
They were implemented as def instead of val to avoid class initialization failures during JVM startup.
Additionally:
Server.default was changed to a lazy val to prevent premature initialization.All Netty integration tests were moved to the new module:
zio-http-netty/src/test
This ensures that Netty-specific functionality is tested only within the Netty module.
All existing tests were executed after the refactor.
zioHttpJVM/test
1191 passed
0 failed
zioHttpNetty/test
552 passed
A few failures were observed in NettyConnectionPoolSpec timeout tests.
These failures appear to be pre-existing flaky tests, as they also occur on the original branch before this refactor.
This change:
zio-http-netty module as the Netty driver implementationNettyServer and NettyClient APIsThis PR focuses only on the Netty module extraction. Future steps in the modularization effort may include:
Harsh Singh
@singhharsh1708
ZIO
@ZIO