How jim-mclaugh/rxnetty works
Project type and purpose
• RxNetty is an open-source, multi-module Java library that adapts Netty’s low-level I/O and channels into a Reactive-Extensions (RxJava) style API.
• It provides a core abstraction layer over raw Netty channels (rxnetty-common), protocol-specific sublibraries for HTTP and TCP (rxnetty-http, rxnetty-tcp), spectator-integration modules for metrics (rxnetty-spectator-http, rxnetty-spectator-tcp), plus example and test-utility modules.
File structure
• Top-level modules in the Gradle settings.gradle:
• rxnetty-common – core abstractions (Connection, ChannelOperations, backpressure handlers).
• rxnetty-http – HTTP client/server on top of rxnetty-common.
• rxnetty-tcp – TCP client/server protocol layer.
• rxnetty-spectator-http/tcp – metrics instrumentation adapters on HTTP/TCP modules.
• rxnetty-examples – runnable code showcasing use-cases for HTTP, TCP, WebSocket, SSE, load-balancing, etc.
• rxnetty-test-utils – mocking/testing helpers for unit and integration tests.
• Each module has its own build.gradle, src/main/java, src/test/java, and configuration (checkstyle, Travis).
Key insights from the README
• Purpose: “Reactive Extension (Rx) adaptor for Netty”.
• Encourages exploring examples for common use cases (HTTP hello-world, TCP echo, streaming, secure connections).
• Guideline to build with Gradle and snapshot artifacts for 0.5.x.
Detail
• In protocol modules, show client vs. server classes (e.g., HttpClient/HttpServer).
• Major bridges (e.g., HttpClientToConnectionBridge).
• Flow of data: Netty channel events → core abstractions → protocol parser → Rx streams → subscriber code.