vert.x

In Vertx I need to redirect all HTTP requests to the same URL but for HTTPS

和自甴很熟 提交于 2020-03-22 08:12:18
问题 I have written a Vertx-web handler in Koltin that redirects any request I receive that is HTTP to HTTPS, and I'm using context.request().isSSL to determine if the request is not SSL, and this worked fine until I put my code behind a load balancer. If the load balancer talks to my Vertx-web server on HTTPS then it thinks all user requests are HTTPS even if they are not. And if I change the load balancer to talk to Vertx-web on HTTP then every request is redirected endlessly even if already the

In Vertx I need to redirect all HTTP requests to the same URL but for HTTPS

坚强是说给别人听的谎言 提交于 2020-03-22 08:11:12
问题 I have written a Vertx-web handler in Koltin that redirects any request I receive that is HTTP to HTTPS, and I'm using context.request().isSSL to determine if the request is not SSL, and this worked fine until I put my code behind a load balancer. If the load balancer talks to my Vertx-web server on HTTPS then it thinks all user requests are HTTPS even if they are not. And if I change the load balancer to talk to Vertx-web on HTTP then every request is redirected endlessly even if already the

技术沙龙|破冰区块链技术,从钱包和智能合约开发入门区块链(西安)

≡放荡痞女 提交于 2020-03-09 14:47:22
身在区块链行业,最近这几个月有一种尘归尘土归土的感觉,随着大众对区块链热度的下降,对于区块链技术圈来说,倒是一件好事。 回归区块链技术本源,不可篡改的技术特性有了越来越多的应用场景,就像几年前的人工智能、大数据一样,真正的技术人才仍然千金难求。 对于数百万的软件开发从业者来说,掌握一些区块链技术,会打开新的技术视角,带来更多技术解决方案,而在区块链技术入门上,钱包开发和智能合约是两个既基础,又重要的,但又相对简单的区块链知识。 11月24日,HiBlock区块链社区在西安发起一场“破冰区块链技术”的沙龙活动 ,邀请胡键和鲍帅两位老师分别从以太坊钱包开发和编写安全的solidity智能合约两个话题分享区块链技术入门方式。此外,还有冯宇老师带来技术视频制作小技巧。 1 时间地点 主题:破冰区块链技术,从钱包和智能合约开发入门区块链 **时间:**11月24日 13:30-17:30 地址 : 西安市高新区沣惠南路36号橡树街区B-10101,哈希屋 (32路;35路;184路;260路;261路;261路区间;280路;324路;411路;高新1号线;高新4号线;高新9号线;高新草堂专线到科技六路中段下车) 本次活动 免费 参加,点击" 阅读原文 "即可报名 2 分享内容 话题1:使用Angular开发以太坊钱包 钱包是区块链应用的必备组件之一,对于任何意图入门区块链开发的开发者来讲

一步步搭建采用Gradle来运行VertX应用的生产环境

别说谁变了你拦得住时间么 提交于 2020-02-29 11:26:15
1.搭建Maven私服 创建 /opt/nexus/ 目录做为nexus的根目录,把 nexus-2.14.5-02-bundle.tar.gz 解压到此目录中 修改 /opt/nexus/nexus-2.14.5-02/conf/nexus.properties 文件,把 application-port 设置成合适的端口 修改 /opt/nexus/nexus-2.14.5-02/bin/jsw/conf/wrapper.conf 文件,配置合适的JVM参数. 3.1在文件的最开始添加 #@wjw_add wrapper.ignore_sequence_gaps=TRUE 3.2添加JVM参数 #->@wjw_add wrapper.java.additional.11=-Djava.net.preferIPv4Stack=true wrapper.java.additional.12=-Dcom.sun.jndi.ldap.connect.pool.protocol="plain ssl" wrapper.java.additional.13=-server wrapper.java.additional.14=-Xms1g wrapper.java.additional.15=-Xmx8g wrapper.java.additional.16=-XX

Mocking a http response using vert.x rxjava2 and Mockito

江枫思渺然 提交于 2020-02-28 23:18:31
问题 I'm playing with the rxjava vert.x (ver. 3.8.4) WebClient. My client will call some services so, by Mockito (ver. 3.2.4) I'm testing how it should handle an error. Here is how I mock the service's response: ... JsonObject jsonResponse = new JsonObject(); HttpResponse<Buffer> httpResponse = Mockito.mock(HttpResponse.class); Mockito.when(httpResponse.statusCode()).thenReturn(500); Mockito.when(httpResponse.bodyAsJsonObject()).thenReturn(jsonResponse); HttpRequest<Buffer> httpRequest = Mockito

Mocking a http response using vert.x rxjava2 and Mockito

余生长醉 提交于 2020-02-28 23:18:18
问题 I'm playing with the rxjava vert.x (ver. 3.8.4) WebClient. My client will call some services so, by Mockito (ver. 3.2.4) I'm testing how it should handle an error. Here is how I mock the service's response: ... JsonObject jsonResponse = new JsonObject(); HttpResponse<Buffer> httpResponse = Mockito.mock(HttpResponse.class); Mockito.when(httpResponse.statusCode()).thenReturn(500); Mockito.when(httpResponse.bodyAsJsonObject()).thenReturn(jsonResponse); HttpRequest<Buffer> httpRequest = Mockito

这是目前最快的 Java 框架,300个框架中排名第一,真香

泪湿孤枕 提交于 2020-02-27 06:43:53
如果您搜索“ 最佳网络框架 ”,您可能会偶然发现Techempower基准测试,其中排名超过300个框架,在那里你可能已经注意到Vert.x是排名最高的。 Vert.x是一个多语言 Web 框架,它支持 Java ,Kotlin,Scala,Ruby和Javascript支持的语言之间的共同功能。 无论语言如何,Vert.x都在Java虚拟机(JVM)上运行。 模块化和轻量级,它面向微服务开发。 Techempower基准测试衡量从数据库更新,获取和交付数据的性能。 每秒提供的请求越多越好。 在这种涉及很少计算的IO场景中,任何非阻塞框架都会有优势。 近年来,这种范式几乎与Node.js不可分割,Node.js通过其单线程事件循环来推广它。 与Node类似,Vert.x运行单个事件循环。 但Vert.x也利用了JVM。 Node运行在单个核心上,而Vert.x维护的线程池大小可以与可用核心数相匹配。 凭借更强的并发支持,Vert.x不仅适用于IO,也适用于需要并行计算的CPU繁重流程。 然而,事件循环只是故事的一半。 另一半与Vert.x几乎没有关系。 Java必备的 15 个框架,推荐看下。 要连接到数据库,客户端需要连接器驱动程序。 在Java领域,Sql最常见的驱动程序是JDBC。 问题是,这个驱动程序阻塞了。 它在套接字级别阻塞。 一个线程总会卡在那里,直到它返回一个响应。

How can I implement custom asynchronous operation in Vert.x?

大城市里の小女人 提交于 2020-02-24 00:44:22
问题 I am newbie in Vert.x. For example, JDBCClient has non-blocking method JDBCClient.getConnection(Handler<AsyncResult<SQLConnection>> handler) When I call it, it is really asynchronous. jdbcClient.getConnection(result -> { /* this code will execute asynchonous */}) But how can I implement my own component with non-blocking methods? When I write for example this, it doesnt looks asynchronous. It just will execute method body and then will call passed lambda. class MyComponent { public void

How can I implement custom asynchronous operation in Vert.x?

非 Y 不嫁゛ 提交于 2020-02-24 00:44:13
问题 I am newbie in Vert.x. For example, JDBCClient has non-blocking method JDBCClient.getConnection(Handler<AsyncResult<SQLConnection>> handler) When I call it, it is really asynchronous. jdbcClient.getConnection(result -> { /* this code will execute asynchonous */}) But how can I implement my own component with non-blocking methods? When I write for example this, it doesnt looks asynchronous. It just will execute method body and then will call passed lambda. class MyComponent { public void

unknown configuration format: hocon (supported formats are: [json, raw, properties]

梦想的初衷 提交于 2020-02-04 23:19:12
问题 I am trying to use the Hocon format for configuration in Vertx. I have also added the maven dependency for it. <dependency> <groupId>com.typesafe</groupId> <artifactId>config</artifactId> <version>1.3.3</version> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-config-hocon</artifactId> <version>3.5.1</version> </dependency> The code compiles fine in eclipse. Vertx vertx = Vertx.vertx(); DeploymentOptions options = new DeploymentOptions(); ConfigStoreOptions store =