vert.x

How to open Swagger-ui from vert.x

走远了吗. 提交于 2019-12-05 22:12:05
问题 I want to implement Swagger-UI in Vert.X app. I have listed all routes and I want to see them in swagger-ui like in SpringBoot. I have also manually edited them in swagger-editor. So, how to open localhost:8080/swagger-ui.html from vert.x app and there to see all routers. I read that i need to save the json from swagger-editor and to put it in src/resources. After that what? Also i found a great stuff here: https://github.com/phiz71/vertx-swagger and http://vertx.io/blog/presentation-of-the

how to enable CORS with Vert.x 2.x

帅比萌擦擦* 提交于 2019-12-05 17:18:28
I am trying to make cross-domain requests with Angularjs 1.4.5. But can't get success. I have configured $httpprovider .config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.useXDomain = true; delete $httpProvider.defaults.headers.common['X-Requested-With']; $httpProvider.defaults.headers.common['Accept']= "application/json, text/plain, */*"; $httpProvider.defaults.headers.put["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8"; $httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8"; $httpProvider.interceptors

Vert.X 入门手记 (二) 下载&安装

a 夏天 提交于 2019-12-05 09:14:17
Vert.X 中文站:vertx.tk(临时域名) 目前中文化正在进行中,有人来帮忙否?? QQ交流群:219655467 下载 官方下载地址:http://vertx.io/downloads.html 本系列文章所使用的是 2.1RC1版本。 安装要求 Vert.X支持 Linux OSX Windows系统。 JDK必须使用 1.7 版本以上,并已经配置了JAVA_HOME & PATH 安装 将下载的压缩包解压至硬盘,并将该目录/bin 引入到PATH中即可。 安装成功请在CMD/SHELL窗口中输入 vertx version 命令,如下即表示安装成功 C:\Users\Administrator>vertx version 2.1RC1 (built 2014-02-26 13:51:32) 简单示例 编写一个Server代码,本处使用Java语言,文件名为Server.java import org.vertx.java.core.Handler; import org.vertx.java.core.http.HttpServerRequest; import org.vertx.java.platform.Verticle; public class Server extends Verticle { public void start() { vertx

Vert.x Blueprint 系列教程(二) | Vert.x Kue 教程(Web部分)

爷,独闯天下 提交于 2019-12-05 09:14:03
上部分蓝图教程 中我们一起探索了如何用Vert.x开发一个基于消息的应用。在这部分教程中,我们将粗略地探索一下 kue-http 模块的实现。 Vert.x Kue REST API kue-http 模块中只有一个类 KueHttpVerticle ,作为整个REST API以及UI服务的实现。对REST API部分来说,如果看过我们之前的 Vert.x 蓝图 | 待办事项服务开发教程 的话,你应该对这一部分非常熟悉了,因此这里我们就不详细解释了。有关使用Vert.x Web实现REST API的教程可参考 Vert.x 蓝图 | 待办事项服务开发教程 。 将Kue UI与Vert.x Web进行适配 除了REST API之外,我们还给Vert.x Kue提供了一个用户界面。我们复用了Automattic/Kue的用户界面所以我们就不用写前端代码了(部分API有变动的地方我已进行了修改)。我们只需要将前端代码与Vert.x Web适配即可。 首先,前端的代码都属于静态资源,因此我们需要配置路由来允许访问静态资源: router.route().handler(StaticHandler.create(root)); 这样我们就可以直接访问静态资源咯~ 注意到Kue UI使用了 Jade (最近貌似改名叫Pug了)作为模板引擎,因此我们需要一个Jade模板解析器。好在Vert.x

How to get POST form data using VERTX handlers?

巧了我就是萌 提交于 2019-12-05 04:56:19
问题 I am able to get the form data using the buffer handler, but it is a void function and I cannot return the form data values. Have about 4-7 forms total, I don't want to end up writing the same handler over and over because the default function is void. html: <!DOCTYPE html> <html> <head><title>Login Page</title></head> <body> <a href="/activateUserPage">activate user</a> <br/> <a href="/login">log in</a> <br/> <form id='login' action='/login' method='post'> <fieldset > <legend>Login</legend>

vertx NoClassDefFoundError: io/netty/channel/EventLoopGroup

会有一股神秘感。 提交于 2019-12-05 01:47:41
问题 this is probably a stupid question, but which jar needs to be referenced besides vertx-core jar in order to run a simple verticle example. I have code like this: package examples.vertx; import io.vertx.core.Vertx; public class VertxApp { public static void main(String[] args) { Vertx vertx = Vertx.vertx(); vertx.deployVerticle(new MyVerticle("name1"), stringAsyncResult -> { System.out.println("MyVerticle deployed"); }); } } and package examples.vertx; import io.vertx.core.AbstractVerticle;

How does vert.x achieve superior performance compared to Netty?

末鹿安然 提交于 2019-12-04 16:02:06
问题 The recent TechEmpower performance benchmarks have been showing vert.x on top of Netty, sometimes by a large amount. According to its website, vert.x uses Netty for "much of its network IO". If so, how does it achieve superior performance as compared to Netty? (Note: This is not intended to be controversial or flamebait - I really want to know the computer science reasons behind the performance difference. Thanks.) 回答1: It depends which benchmark and which round you are talking about, rounds

Vert.x Blueprint 系列教程(二) | 开发基于消息的应用

我是研究僧i 提交于 2019-12-04 09:22:45
Vert.x 蓝图项目已经发布至Vert.x官方网站: Vert.x Blueprint Tutorials 本文章是 Vert.x 蓝图系列 的第二篇教程。全系列: Vert.x Blueprint 系列教程(一) | 待办事项服务开发教程 Vert.x Blueprint 系列教程(二) | 开发基于消息的应用 - Vert.x Kue 教程 Vert.x Blueprint 系列教程(三) | Micro Service 微服务实战 前言 欢迎回到Vert.x 蓝图系列~在本教程中,我们将利用Vert.x开发一个基于消息的应用 - Vert.x Kue,它是一个使用Vert.x开发的优先级工作队列,数据存储使用的是 Redis 。Vert.x Kue是 Automattic/kue 的Vert.x实现版本。我们可以使用Vert.x Kue来处理各种各样的任务,比如文件转换、订单处理等等。 通过本教程,你将会学习到以下内容: 消息、消息系统以及事件驱动的运用 Vert.x Event Bus 的几种事件机制(发布/订阅、点对点模式) 设计 分布式 的Vert.x应用 工作队列的设计 Vert.x Service Proxy (服务代理,即 异步RPC )的运用 更深层次的Redis运用 本教程是 Vert.x 蓝图系列 的第二篇教程,对应的Vert.x版本为 3.3.2

Vert.X 入门手记 (一) 介绍

隐身守侯 提交于 2019-12-04 09:22:18
Vert.X 中文站:vertx.tk(临时域名) 目前中文化正在进行中,有人来帮忙否?? QQ交流群:219655467 介绍 Vert.X是一个异步网络应用开发框架,用来开发高并发、异步、可伸缩、多语言支持的Web应用。它类似Node.JS,但是不仅仅支持JavaScript,还支持Java、Groovy、Python、Ruby等其他语言。借助Netty作为一个核心处理引擎,改变了当前JEE中常见的阻塞式模型应用的开发,带领大家进入了一个新的Web应用开发领域。 特性 Polyglot:说白一点,就是只要能在JVM上运行的常见语言,都可以直接编写基于Vert.X的应用,目前官方支持的有 Java, JavaScript, CoffeeScript, Ruby, Python or Groovy,据说Node.JS会作为一个JavaScript实现来引入到Vert.X的模块中。 Simplicity:看似简单,其实并不“简单”,Vert.X会帮助你很简单的实现基于异步处理的Web应用,你并不需要关注线程之间的调用、同步等繁琐事情,它帮你实现了一个非常不简单的事情。 Scalability:Vert.X的设计是基于Actor模型的,你可以将一个或多个的程序放入到容器中去执行,可以很轻松的进行部署和升级,很方便的对应用进行水平扩展,动态升级。 Concurrency:Vert

How to open Swagger-ui from vert.x

烂漫一生 提交于 2019-12-04 03:18:15
I want to implement Swagger-UI in Vert.X app. I have listed all routes and I want to see them in swagger-ui like in SpringBoot. I have also manually edited them in swagger-editor. So, how to open localhost:8080/swagger-ui.html from vert.x app and there to see all routers. I read that i need to save the json from swagger-editor and to put it in src/resources. After that what? Also i found a great stuff here: https://github.com/phiz71/vertx-swagger and http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/ But how to implement it? Well, you started in the wrong direction a bit. Those