<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=Vert.x_introduction</id>
	<title>Vert.x introduction - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=Vert.x_introduction"/>
	<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=Vert.x_introduction&amp;action=history"/>
	<updated>2026-06-03T00:52:29Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=Vert.x_introduction&amp;diff=3761&amp;oldid=prev</id>
		<title>Riguz：​Riguz移动页面Blog:Vert.X(1)：简介至Vert.x introduction，不留重定向</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=Vert.x_introduction&amp;diff=3761&amp;oldid=prev"/>
		<updated>2023-12-19T05:49:48Z</updated>

		<summary type="html">&lt;p&gt;Riguz移动页面&lt;a href=&quot;/index.php?title=Blog:Vert.X(1)%EF%BC%9A%E7%AE%80%E4%BB%8B&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Blog:Vert.X(1)：简介（页面不存在）&quot;&gt;Blog:Vert.X(1)：简介&lt;/a&gt;至&lt;a href=&quot;/Vert.x_introduction&quot; title=&quot;Vert.x introduction&quot;&gt;Vert.x introduction&lt;/a&gt;，不留重定向&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023年12月19日 (二) 05:49的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Riguz</name></author>
	</entry>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=Vert.x_introduction&amp;diff=2636&amp;oldid=prev</id>
		<title>imported&gt;Riguz：​最开始了解到Vert.X是在[Web Framework Benchmarks](https://www.techempower.com)中看到，性能超群的一个web框架，但说实话知名度不是特别高。

![Vert.X Benchmark](/images/Vert.x_Benchmark.png)</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=Vert.x_introduction&amp;diff=2636&amp;oldid=prev"/>
		<updated>2020-12-07T00:00:00Z</updated>

		<summary type="html">&lt;p&gt;最开始了解到Vert.X是在[Web Framework Benchmarks](https://www.techempower.com)中看到，性能超群的一个web框架，但说实话知名度不是特别高。  ![Vert.X Benchmark](/images/Vert.x_Benchmark.png)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;最开始了解到Vert.X是在[https://www.techempower.com Web Framework Benchmarks]中看到，性能超群的一个web框架，但说实话知名度不是特别高。&lt;br /&gt;
&lt;br /&gt;
[[File:Vert.x_Benchmark.png|600px|Vert.X Benchmark]]&lt;br /&gt;
&lt;br /&gt;
而官网介绍也谦逊的很，甚至都说自己不算一个web框架，而是一个&amp;quot;tool-kit&amp;quot;：&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Eclipse Vert.x is a tool-kit for building reactive applications on the JVM.&lt;br /&gt;
&lt;br /&gt;
= 特点=&lt;br /&gt;
&lt;br /&gt;
Vert.x采取的是事件驱动的非阻塞异步响应模型，而不是类似Servlet一样为每一个连接分配一个新的线程。这样做的好处就是可以利用少量的线程处理很多的并发连接。而采取blocking IO的线程在等待IO操作完成的时候，线程会被挂起，而后唤醒。但是这个操作本身也是有一定的开销的，当线程数很大的时候这个开销就尤为明显。&lt;br /&gt;
&lt;br /&gt;
简单来说，Vert.x就是JVM版本的NodeJS，但一个比较大的区别就是NodeJS是单线程模型的，而Vert.x可以有多个event loop，因此能够更加有效的利用多核的优势。&lt;br /&gt;
&lt;br /&gt;
Vert.x的另一个特点就是提供了多种语言的绑定（并不仅仅是简单的wrap一下，而且充分利用了各个语言的特点）：&lt;br /&gt;
&lt;br /&gt;
* Java&lt;br /&gt;
* JavaScript&lt;br /&gt;
* Groovy&lt;br /&gt;
* Ruby&lt;br /&gt;
* Kotlin&lt;br /&gt;
* Scala&lt;br /&gt;
&lt;br /&gt;
== 什么是响应式（Reactive）==&lt;br /&gt;
&lt;br /&gt;
根据[https://www.reactivemanifesto.org/ The Reactive Manifesto]的定义，一个响应式的系统具有四个特点：&lt;br /&gt;
[[File:https://www.reactivemanifesto.org/images/reactive-traits.svg|600px|Reactive manifesto]]&lt;br /&gt;
&lt;br /&gt;
* Responsive：The system responds in a timely manner if at all possible. &lt;br /&gt;
* Resilient：The system stays responsive in the face of failure.&lt;br /&gt;
* Elastic: The system stays responsive under varying workload. &lt;br /&gt;
* Message-driven: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation and location transparency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 组件==&lt;br /&gt;
&lt;br /&gt;
Vert.x又包含了很多个部分：&lt;br /&gt;
&lt;br /&gt;
=== Web组件===&lt;br /&gt;
&lt;br /&gt;
* Core: 包含底层的Http/TCP、文件等的访问功能。&lt;br /&gt;
* Web: 可以用来创建Web应用和微服务&lt;br /&gt;
* Web Client: http请求客户端&lt;br /&gt;
* Web API Contract: 用来实现契约先行的开发模式以及契约测试&lt;br /&gt;
* 其他: Web API Service, Web GraphQL Handler等，不过目前都还在Technical Preview阶段&lt;br /&gt;
&lt;br /&gt;
=== 数据访问===&lt;br /&gt;
数据访问组件提供了一系列的异步访问client，当然也可以直接使用原始的数据库驱动。支持的数据库有：&lt;br /&gt;
&lt;br /&gt;
* MongoDB client&lt;br /&gt;
* Redis client&lt;br /&gt;
* Cassandra client&lt;br /&gt;
* SQL Common&lt;br /&gt;
* JDBC client&lt;br /&gt;
* Reactive MySQL/DB2/PostgreSQL client(Technical preview)&lt;br /&gt;
&lt;br /&gt;
=== Reactive===&lt;br /&gt;
提供了各种创建响应式应用程序的组件。&lt;br /&gt;
&lt;br /&gt;
* Vert.x Rx: 不喜欢回调可以使用RxJava风格的API&lt;br /&gt;
* Reactive streams: 可以与Akka/Project Reactor等其他reactive系统交互&lt;br /&gt;
* Vert.x Sync: 用来部署使用fiber(纤程，一种轻量级的线程)的节点，可以编写串行化风格的代码&lt;br /&gt;
* Kotlin coroutines: 携程的支持，可以使用`async/await`或者channels。&lt;br /&gt;
&lt;br /&gt;
=== Microservices===&lt;br /&gt;
创建微服务的组件：&lt;br /&gt;
&lt;br /&gt;
* service discovery&lt;br /&gt;
* circuit breaker&lt;br /&gt;
* config&lt;br /&gt;
&lt;br /&gt;
=== MQTT===&lt;br /&gt;
提供了MQTT的server和client端组件。&lt;br /&gt;
&lt;br /&gt;
=== Authentication and Authorisation===&lt;br /&gt;
认证授权相关：&lt;br /&gt;
&lt;br /&gt;
* Auth common&lt;br /&gt;
* JDBC auth&lt;br /&gt;
* JWT auth&lt;br /&gt;
* Shiro auth&lt;br /&gt;
* MongoDB auth&lt;br /&gt;
* OAuth2&lt;br /&gt;
* .htdigest Auth&lt;br /&gt;
&lt;br /&gt;
=== Messaging===&lt;br /&gt;
&lt;br /&gt;
* AMQP client(Technical preview)&lt;br /&gt;
* STOMP client &amp;amp; Server&lt;br /&gt;
* RabbitMQ client&lt;br /&gt;
* AMQP bridge&lt;br /&gt;
&lt;br /&gt;
=== 其他===&lt;br /&gt;
&lt;br /&gt;
* Kafka client&lt;br /&gt;
* Mail client: SMTP 客户端&lt;br /&gt;
* Consul client&lt;br /&gt;
* JCA Adaptor&lt;br /&gt;
* Event Bus bridge:TCP/Apache camel&lt;br /&gt;
* Health check&lt;br /&gt;
* Metrics&lt;br /&gt;
* Shell&lt;br /&gt;
* Docker&lt;br /&gt;
* Vert.x Unit&lt;br /&gt;
* ... &lt;br /&gt;
&lt;br /&gt;
= 使用=&lt;br /&gt;
== Hello World==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class VertxEcho {&lt;br /&gt;
    public static void main(String[] args) {&lt;br /&gt;
        Vertx vertx = Vertx.vertx();&lt;br /&gt;
&lt;br /&gt;
        vertx.createNetServer()&lt;br /&gt;
            .connectHandler(socket -&amp;gt; {&lt;br /&gt;
                socket.handler(buffer -&amp;gt; {&lt;br /&gt;
                    socket.write(&amp;quot;Hello:&amp;quot; + buffer);&lt;br /&gt;
                });&lt;br /&gt;
            })&lt;br /&gt;
            .listen(3000);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Riguz</name></author>
	</entry>
</feed>