What is the difference between Vert.x and Netty? Why should one ever prefer Netty over Vert.x?
Both of them are event-driven, non-blocking and asynchronous frameworks designed for high-load I/O.
Vert.x is based on Multi-Reactor pattern (Node's style event loop on multithreaded JVM) but Netty use Interceptor Chain Pattern. When Interceptor Chain Pattern has any benefits over Multi-Reactor pattern ?
I just have a quick look at Netty's documentation, but it seems Vert.x has some extra funcitonality over Netty. I.e. Vertx is a standalone server, it's a polyglot, provide HA and clustering out-of-the-box.
Also Vert.x has little bit better benchmarks than Netty.
P.S. Disclaimer - I appreciate Vert.x very much, and not familiar with Netty. So by asking Why should one ever prefer Netty over Vert.x?
I just trying to compare both of them.
Vert. x uses low level IO library Netty. The application framework includes these features: Polyglot.
Vert. x is a server framework that provides API and functions different and independent from Netty, designed with different purpose from Netty. Netty is a framework that can process the low-level IO and Vert. x can process the higher-level IO than Netty.
x website (vertx.io) says, “Eclipse Vert. x is a toolkit for building reactive applications on the JVM.” It is event-driven, single-threaded, and non-blocking, which means you can handle many concurrent apps with a small number of threads. (If you know how the Node. js event loop works, Vert.
Vert. x is a polyglot web framework that shares common functionalities among its supported languages Java, Kotlin, Scala, Ruby, and Javascript. Regardless of language, Vert. x operates on the Java Virtual Machine (JVM). Being modular and lightweight, it is geared toward microservices development.
The difference is Vert.x is based on Netty. If you take a peek at the pom.xml
in vertx-core you'll find:
<!-- We depend on the specific Netty dependencies not netty-all to reduce the size of fatjars -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
And the Netty version for Vert.x 3.5.0-SNAPSHOT
is: 4.1.8.Final
Vert.x is an entire toolkit and ecosystem of pluggable modules on top of Netty for building reactive applications on top of the JVM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With