转自:http://www.cnblogs.com/huligong1234/p/4983869.html
Vert.x入门体验
一、概述
Vert.x(http://vertx.io)是一个基于JVM、轻量级、高性能的应用平台,非常适用于最新的移动端后台、互联网、企业应用架构.
二、安装配置
- 访问Vert.x官网 http://vertx.io下载Vert.x包vert.x-3.1.0-full.zip
- 配置环境变量
创建环境变量VERTX_HOME=C:\vertx
将%VERTX_HOME%\bin 追加到path变量上。
通过vertx -version命令查看版本号
三、 示例
3.1 Vertx-Java命令行运行
//EchoServer.java
import io.vertx.core.AbstractVerticle;
public class EchoServer extends AbstractVerticle {
publicvoidstart() {
vertx.createHttpServer().requestHandler(req -> {
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!");
}).listen(8080);
}
}
vertx run EchoServer.java
curl http://localhost:8080/
3.2 Vertx-Java main方法方式运行
//pom.xml
...
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
...
//App.java
import io.vertx.core.Vertx;
public class App {
publicstaticvoidmain(String[] args) {
Vertx.vertx().createHttpServer().requestHandler(req -> req.response().
end("Hello World!")).listen(8080);
}
}
In IDE, Run AS Java Application
curl http://localhost:8080/
3.3 Vertx-JavaScript命令行运行
//echo_server.js
vertx.createHttpServer().requestHandler(function (req) {
req.response().putHeader("content-type", "text/html").end("<html><body><h1>
Hello fromvert.x!</h1></body></html>");
}).listen(8080);
vertx run echo_server.js
curl http://localhost:8080/
四、更多参考
-
关于Java框架Vert.x的几点思考
http://www.csdn.net/article/2015-05-20/2824733-Java
相关推荐
Vert.x 内核小巧轻便. 你只需使用你想要的部分. 它还可以完全嵌入到您现有的应用程序中--我们不会强迫您以特殊的方式构建应用程序,以便您可以使用 Vert.x. Vert.x核心为以下事情提供功能: 编写TCP客户端和服务器 ...
《Vert.x应用开发实例教程》旨在为Vert.x的初学者和大中专院校学生提供易于入门,全面了解和掌握Vert.x框架技术和应用的教材和辅导资料,为使用Vert.x开发实时应用和企业级应用打下良好的基础。
Vert.x是事件驱动的,其处理请求的高性能也是基于其事件机制。Vert.x的事件机制中有几个非常重要的概念:Event Loop、Event Loop Vertical、Worker Vertical、Event Bus、Vert.x Module。 Event Loop:即事件循环,...
Vert.x是一个在JVM开发reactive应用的框架,可用于开发异步、可伸缩、高并发的Web应用(虽然不限于web应用)。其目的在于为JVM提供一个Node.js的替代方案。开发者可以通过它使用JavaScript、Ruby、Groovy、Java,甚至...
vert.x结合springboot开发mqtt服务端,直接启动主类。
在发布Vert.x实例时,需要传入一个VertxOptions来实现针对Vert.x的配置项的管理
Zero Ecotope Framework 是一个基于 Vert.x 的中间件容器,它可以帮助软件开发人员在 Vert.x 中快速开发和实施,集中精力处理项目需求中的业务逻辑而忽略开发过程中的部分细节,项目起源于早期在 Vert.x 生态中缺少...
vert.x-2.1.2.tar.gz 下载
Vert.X-generator是基于javafx8开发的图形界面Vert.x代码生成器,使用 Apache FreeMarker 作为代码文件的模板,用户可以一键将数据库中的表生成为任意风格的.java代码文件(比如经典的三层模型);该工具支持所有实现JDBC...
vert.x中文 PDF 下载
vertx-kue, Vert.x Blueprint项目 Vert.x Kue,这是由 Vert.x 支持的优先级任务队列 Vert.x Kue Vert.x Kue 是用 Vert.x 开发的优先级任务队列,并以的Redis支持。 它是 automattic/kue的Vert.x 实现版本。这个蓝图...
vert.x是内存占用极小的快速开发框架,springboot模版项目
Vert.x系列: Vert.x介绍:https://blog.csdn.net/haoranhaoshi/article/details/89279096 Vert.x实战一:Vert.x通过Http发布数据:https://blog.csdn.net/haoranhaoshi/article/details/89284847 Vert.x实战二:TCP...
Vert.x3.4.2full.zip
Eclipse Vert.x is event driven and non blocking. This means your app can handle a lot of concurrency using a small number of kernel threads. Vert.x lets your app scale with minimal hardware.
Vert.x 初始demo, 里面有打包好的jar,可以直接运行
JetLinks 基于Java8,Spring Boot 2.x ,WebFlux,Netty,Vert.x,Reactor等开发, 是一个全响应式的物联网平台。支持统一物模型管理,多种设备,多种厂家,统一管理。统一设备连接管理,多协议适配(TCP,MQTT,UDP,CoAP,HTTP等)...
A beautifully clear tutorial on Vert.x, it helps you develop a real-time web application from the ground up. Overview Get started with developing applications for the real-time web From concept to ...
A beautifully clear tutorial on Vert.x, it helps you develop a real-time web application from the ground up. Overview Get started with developing applications for the real-time web From concept to ...