Netty Blog
netty.io · Company blog · on HN since 2012
The Netty project blog announces releases of Netty, a Java framework for asynchronous, event-driven network applications.
What HN saysHN links it for release notes, such as a fixed memory leak in 4.1.85, and commenters mention moving from Tomcat to Netty.
27HN people shared it
20linked it in comments
23stories submitted
186story points
1 year agolast shared
2012people per year2026
Most-shared posts
- 1Netty: Asynchronous event-driven network application framework12 people · 1 points · first shared 2012 · discussion on HN
- 2Twitter adds SPDY support to Netty2 people · 121 points · first shared 2012 · 18 comments on HN
- 3Netty 4.1.0.Final released2 people · 3 points · first shared 2016 · discussion on HN
- 4Using Netty as a generic library1 people · 33 points · first shared 2015 · discussion on HN
- 5Netty 4.1.74.Final Released1 people · 5 points · first shared 2022 · discussion on HN
- 6Netty 4.0.48.Final and 4.1.12.Final released1 people · 3 points · first shared 2017 · discussion on HN
- 7Netty 4.1.0.CR5 released1 people · 3 points · first shared 2016 · discussion on HN
- 8Netty 4.0.49.Final and 4.1.13.Final released1 people · 2 points · first shared 2017 · discussion on HN
- 9Netty 4.1.55.Final Released1 people · 2 points · first shared 2020 · discussion on HN
- 10Netty 4.0.42.Final and 4.1.6.Final released1 people · 1 points · first shared 2016 · discussion on HN
- 11Netty/Incubator/Transport/Native/Io_uring 0.0.1.Final Released1 people · 1 points · first shared 2020 · discussion on HN
- 12Netty 4.1.59.Final released – fix CVE-2021-21290 Disclosure vuln1 people · 1 points · first shared 2021 · discussion on HN
- 13Netty 3.10.5.Final released bug-fix when handling SSL1 people · 1 points · first shared 2015 · discussion on HN
- 14Netty 4.0.29.Final released1 people · 1 points · first shared 2015 · discussion on HN
- 15Netty 4.0.34 released (openssl)1 people · 1 points · first shared 2016 · discussion on HN
What HN people wrote when they linked it
Mikera · 2012-05-12
First off, 48h is a tough call - the JVM is a huge ecosystem! You might want to moderate your expectations.
Personal suggestions would be:
- Get one of the major open source IDEs. I personally recommend Eclipse (http://www.eclipse.org/)
- Learn some Java first. Since it's the Ligua France on the JVM, you'll want to know it if only so you can read code. If you like your more modern languages you can always switch to Scala/Clojure later once you are familiar with the Java ecosystem.
- Play (http://www.playframework.org/) is a great framework for your web app. Give it a try.
- Netty is a great IO framework (http://netty.io/). If you really care about IO performance, you will probably want to use Netty (or something based on Netty). I've used Netty for low-latency game servers, for example.
winterland1989 · 2021-04-07
To every Haskellers here:
I'm happy to announce [Z.Haskell](http://z.haskell.world/) project, It's available on Hackage and very much usable now, the document is also pretty adequate.
To recap the document from Z.Haskell, Z.Haskell provides:
+ Array, vector(array slice), sorting, searching
+ Text based UTF-8, basic Unicode manipulating, regex
+ FFI utilities
+ Fast parsing and building monad
+ JSON encoding and decoding
+ IO resource management, resource pool
+ File system operations
+ Network: DNS, TCP, UDP and IPC
+ Buffered input and output
+ Process management
+ Environment settings
+ High performance logger
+ High performance low-resolution timer
The project's goal is not to compete with the base, but to provide an alternative engineering toolkit, which is more suitable for writing practical network/storage services. Similar to [netty](https://netty.io/) for java or [nodejs](https://nodejs.org/) for javascript. Welcome to join Z.Haskell if you have a similar use case. Currently, we're heading with the following roadmap:
+ Crypto library based on [botan](https://github.com/ZHaskell/z-botan).
+ TLS network stack.
+ HTTP framework.
+ Distributed system algorithms.
Happy hacking!
Z.Haskell Contributors
reidrac · 2022-12-05
I haven't looked at the graphs, but they updated netty to 4.1.85.Final on 2022-11-10.
https://netty.io/news/2022/11/09/4-1-85-Final.html mentions that a potential memory leak was fixed. In includes a debug log warning of the leak; but enabling debug logging may be a no-no.
Perhaps could be worth reverting that and see if there's any change. Sounds cheap and harmless.
mooreds · 2022-01-17
We looked around since we wanted to move off Tomcat and decided on Netty: https://netty.io/
I'm not on the engineering team so can't speak to the cost/benefit, but it seems to have been a pretty successful transition.
saurik · 2021-04-23
It seems like nothing to do with Netty, right? https://netty.io/
brabel · 2021-02-13
Java developers are spoiled for choice.
There's everything, from the simplest possible https://sparkjava.com/, to the a little bit nicer https://javalin.io/ (which has a Kotlin wrapper), to the high performance and full framework https://vertx.io/ (which always had great multi-lingual support within the JVM), to the newer and GraalVM-friendly https://micronaut.io/ and https://quarkus.io/ ... for the Enterprise-only crowd, you still have the JEE successor, https://jakarta.ee/ and Oracle's own https://helidon.io/#/ (which likes to position itself as microservice focused, like Micronaut and Quarkus). Not to mention lower level libraries you can use, like https://www.eclipse.org/jetty/ and https://netty.io/.
Ktor has a tough fight to become dominant even in the Kotlin world.
Spring Boot is, still, definitely the most popular option, but it's still just one of very very many!
tomfitz · 2017-04-30
If you find ByteBuffer's API awkward/insufficient, you might want to consider one of the replacements:
* Netty's: https://netty.io/4.0/api/io/netty/buffer/ByteBuf.html as used by Netty
* Agrona's, as used by Aeron and SBE: http://insightfullogic.com/2015/Apr/18/agronas-threadsafe-offheap-buff…
chillaxtian · 2017-02-20
if you need to do high performance networking, netty is a must have.
http://netty.io/
mike_hearn · 2017-02-06
A telnet server is just a socket connected to a pty, no? I'm not sure there's much to it, which is why it's so easy in node.
I guess in java you'd do the same program something like this:
ServerSocket server = new ServerSocket(8080);
while (true) {
try (Socket sock = server.accept()) {
sock.getOutputStream().write("Hello world!".getBytes());
}
}
It's a bit more verbose, but hey, that's Java.
I think maybe the issue there is you got distracted by the idea that you needed a library. Commons-Net doesn't actually provide a telnet server because it doesn't need to.
That said, I agree that Commons-Net doesn't have great docs. I think it's fallen out of use over time. These days if you wanted a powerful non-blocking socket library you'd use Netty or VertX. The docs for Netty are much better:
http://netty.io/wiki/index.html
crudbug · 2016-02-19
How is it different from Netty [1] / Reactor [2] ?
[1] http://netty.io
[2] http://projectreactor.io
jbrechtel · 2013-09-15
Natural Language Processing libraries
https://opennlp.apache.org/
http://nlp.stanford.edu/
Cloud provider automation libraries
http://jclouds.incubator.apache.org/
Distributed stream computing
https://incubator.apache.org/s4/
Asynchronous event driven IO, battle tested, mother recommended
http://netty.io/
In-process webserver
http://www.eclipse.org/jetty/
....to name a few. It's probably useful to take some thing that you'll need and look in ecosystem X for it (say... .NET) and then compare what's available there to what's available on the JVM. In my experience, the JVM wins out almost every time when it comes to number of options and maturity of options.
dlandiak · 2023-12-18
You are correct. TBMQ is based on Spring Boot.
We use Netty (https://netty.io/) as the source of the MQTT communication, and we build the MQTT features the MQTT broker should support ourselves on top of that.
Kafka is used to implement scalable, fault-tolerant solution with reliable message persistence. Additionally, it helped to gain high-throughput processing and low-latency message delivery. We store published MQTT messages, client sessions, and subscriptions, etc., in Kafka. It proved its quality in practice and with performance tests.
Redis is currently used for caching in cluster mode. In our roadmap, we also have a ticket to add the ability to store MQTT messages there. So, it will be a so-called Redis integration.
Please see the architecture doc for more details: https://thingsboard.io/docs/mqtt-broker/architecture/
We have implemented TBMQ to satisfy our enterprise customers' needs. Some of them used hivemq before but decided to ask us to build a new solution (TBMQ) as they were not fully satisfied with hivemq. One of the most important advantages we provided is cluster support in our open-source version compared to hivemq.
chromanoid · 2017-02-12
bad_user · 2013-08-06
So even if Scala is ahead in this (flawed) benchmark, that's not how you write a TCP server in Scala, because you want to do it non-blocking. Not doing it based on asynchronous I/O means that in a real-world scenario the server will choke under the weight of slow connections, not to mention be susceptible to really cheap DoS attacks like Slowloris [1].
Seriously, it goes beyond the underlying I/O API that you're using. If anywhere in the code you're reading from an InputStream or you're writing to an OutputStream that's connected to an open socket, then that's a blocking call that can crush your server. Right now, every Java Servlets container that's not compatible with the latest Servlets API 3.1 can be brought down with Slowloris, even if under the hood they are using NIO.
Option A for writing a server in Scala is Netty [2].
Option B for writing a server in Scala is the new I/O layer in Akka [3].
[1] http://ha.ckers.org/slowloris/
[2] http://netty.io/
[3] http://doc.akka.io/docs/akka/snapshot/scala/io.html
ojhughes · 2025-05-18
netty-tcnative can remove the need for a Java keystore in Netty based applications https://netty.io/wiki/forked-tomcat-native.html
shouldbworking · 2017-04-22
Netty is hardly the example of a hype driven framework. I'm not sure when it was first released but I've found references from version 2.0 in 2004. It may be older than HAProxy.
Netty is a far more robust, faster, and easier to use framework for TCP proxies than the one the author cooked up and I'm getting downvoted like crazy for saying it.
It's also used internally by Google, Twitter, and netflix. It's embedded in the GRPC library, Cassandra's database driver, Play framework, and Vert.x among many others. Check their related projects page https://netty.io/wiki/related-projects.html
Netty is a phenomenal project, and had the author known about it, I doubt he would have spent the time writing his own TCP proxy.
jgrahamc · 2012-03-08
Probably using the code for SPDY that they contributed to Netty: http://netty.io/blog/2012/02/04/
mleonhard · 2021-03-04
You can do this with TCP keepalives [0]. Under Linux, a process can enable the SO_KEEPALIVE option on sockets to request that the Linux kernel send TCP keepalives periodically. A kernel option determines how frequently the kernel sends TCP keepalive packets. It is a single option that applies to all sockets of all processes. One can also configure the OS to enable SO_KEEPALIVE by default on all sockets of all processes.
Golang's GRPC library implements keepalives at the GRPC protocol level [1]. It provides a `Context` value [2] that code can use to detect peer disconnect and cancel expensive operations.
Golang's HTTP server API does not provide any way to detect peer disconnect before sending the final response [3].
Rust cannot set SO_KEEPALIVE [4]. One could possibly implement keepalives by writing zero-length chunks to the socket.
Java's Netty server library can set SO_KEEPALIVE [5]. One can then code a request handler that periodically checks if the socket is connected [6] and cancels expensive operations. Unfortunately, there is standard tooling to do this.
EDIT: You did mention TCP keepalives. I was not aware that some routers drop them. Can you link to any data on the prevalence of tcp-keepalive dropping for various kinds of client connections: home router, corporate wifi, mobile carrier-grade-NAT?
[0] https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html
[1] https://pkg.go.dev/google.golang.org/grpc/keepalive
[2]…
moonchrome · 2012-02-06
Why don't you just lock each connection handler to one thread at a time and dispatch events on a thread pool ? That way connection level events are always synchronous, but event handlers are spread over the thread pool, you get optimal load balancing because events fill the pool (no processes) and thread pool can use it's own logic to grow if one channel handler used blocking IO and is blocking the a pool thread.
This is pretty much what netty does with OrderedMemoryAwareThreadPoolExecutor ?
http://netty.io/docs/stable/api/org/jboss/netty/handler/execution/Orde…
-------------------------------------> Timeline ------------------------------------>
Thread X: --- Channel A (Event A1) --. .-- Channel B (Event B2) --- Channel B (Event B3) --->
\ /
X
/ \
Thread Y: --- Channel B (Event B1) --' '-- Channel A (Event A2) --- Channel A (Event A3) --->