Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.[1]
Netty is a networking software framework used in the core infrastructure at many major organizations including Twitter[a] & Netflix[b] .
You can use the following guide to setup your environment so you can build the source code:
[Netty Developer Guide Steps to Build the Source Code]
There were some modifications I needed to make to get the code to build successfully. The following are the steps I used to build the source code on a mac.
Steps
-
Install the Java 11 JDK [c].
This can be downloaded from Oracle or number of other vendors as listed in the developer guide.I downloaded the
x64 DMG Installer
and went through the prompts.I recommend updating your
.bash_profile
[d] file to automatically set yourJAVA_HOME
environment variable.Add the following anywhere in the file:
alias setJdk11='export JAVA_HOME=$(/usr/libexec/java_home -v 11)' setJdk11
-
Install Maven
I had maven version 3.5.3 installed (Apache Maven 3.8.6 is the latest release). -
Install Git
Not necessary to build, but needed to commit and contribute code changes.“if using MacOS, when you commit code, CRLF will be automatically converted to LF” by setting the following property:
git config --global core.autocrlf input
- Install Additional Listed Packages
brew install autoconf automake libtool openssl
These are some packages listed in the guide to install.
- Install Apple Command Line Tools[e]
xcode-select --install
- Build the Source!
Run the following command in the base soure code directory../mvnw clean install -DskipTests -T1C
If successful, the following will be printed.
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:36 min (Wall Clock) [INFO] Finished at: 2022-11-12T00:31:11-08:00 [INFO] ------------------------------------------------------------------------
What I Didn’t Do
Because I got a few build errors in the netty5-transport-native-unix-common
module, I immedaitely thought I had to go through the steps in the section of the developer guide entitled “Building the native transports”. It turns out that it was not necessary; however, it confused me a bit.
References
[1] Various Authors. “Netty: Home.” The Netty Project, 2022, URL.
[2] Author Unknown. “Netty at Twitter with Finagle.” Engineering, Twitter, 13 Feb 2014, URL.
[3] (Gonigberg, Arthur; Cohen, Mikey; Smith, Michael; Varadarajan,Gaya; Vinukonda, Sudheer; Aroskar, Susheel). “Open Sourcing Zuul 2.” Netflix Technology Blog, Netflix TechBlog, 21 May 2018, URL.
Notes
[a] Twitter’s core services are built with Finagle, which is built ontop of Netty.[2]
[b] Zuul 2 handles all the requests that come into Netflix’s cloud infrastructure “handling the network protocol, web server, connection management and proxying work.” Netty is “responsible for handling the network protocol, web server, connection management and proxying work”.[3]
[c] The documentation states java 8 is needed; however, the netty5-parent
needs at least java 11.:
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-tools) @ netty5-parent ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 1.8.0-77 is not in the allowed range [11.0.0,).
[d] The .bash_profile
is located in your home directory /Users/$USER/.bash_profile
.
[e] xcrun
is needed by the netty5-transport-native-unix-common
module. You can obtain this by installing Apple Command Line Tools:
[INFO] --- maven-antrun-plugin:1.8:run (build-native-lib) @ netty5-transport-native-unix-common ---
[INFO] Executing tasks
main:
[exec] xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun