Vert.x 和 Netty 有什么区别?
What is the difference between Vert.x and Netty?
Vert.x和Netty有什么区别?为什么人们应该更喜欢 Netty 而不是 Vert.x?
都是为高负载设计的事件驱动、非阻塞、异步的框架I/O。
Vert.x 基于多反应器模式(多线程 JVM 上的节点样式事件循环),但 Netty 使用拦截器链模式。 什么时候拦截器链模式比多反应器模式有优势?
我只是快速浏览了一下 Netty 的文档,但似乎 Vert.x 比 Netty 有一些额外的功能。 IE。 Vertx 是一个独立的服务器,它是一个多语言的,提供开箱即用的 HA 和集群。
另外 Vert.x 的基准比 Netty 好一点点。
P.S。免责声明 - 我非常欣赏 Vert.x,但对 Netty 并不熟悉。所以通过询问 Why should one ever prefer Netty over Vert.x?
我只是想比较它们。
区别在于Vert.x是基于 Netty。如果你看一眼 pom.xml
in vertx-core 你会发现:
<!-- 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>
Vert.x 3.5.0-SNAPSHOT
的 Netty 版本是:4.1.8.Final
Vert.x 是基于 Netty 的可插拔模块的完整工具包和生态系统,用于在 JVM 之上构建反应式应用程序。
Vert.x和Netty有什么区别?为什么人们应该更喜欢 Netty 而不是 Vert.x?
都是为高负载设计的事件驱动、非阻塞、异步的框架I/O。
Vert.x 基于多反应器模式(多线程 JVM 上的节点样式事件循环),但 Netty 使用拦截器链模式。 什么时候拦截器链模式比多反应器模式有优势?
我只是快速浏览了一下 Netty 的文档,但似乎 Vert.x 比 Netty 有一些额外的功能。 IE。 Vertx 是一个独立的服务器,它是一个多语言的,提供开箱即用的 HA 和集群。
另外 Vert.x 的基准比 Netty 好一点点。
P.S。免责声明 - 我非常欣赏 Vert.x,但对 Netty 并不熟悉。所以通过询问 Why should one ever prefer Netty over Vert.x?
我只是想比较它们。
区别在于Vert.x是基于 Netty。如果你看一眼 pom.xml
in vertx-core 你会发现:
<!-- 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>
Vert.x 3.5.0-SNAPSHOT
的 Netty 版本是:4.1.8.Final
Vert.x 是基于 Netty 的可插拔模块的完整工具包和生态系统,用于在 JVM 之上构建反应式应用程序。