vert.x

How to use coroutine inside the router.route(“/api/*”).handler?

蓝咒 提交于 2021-01-05 08:53:54
问题 I am trying to use coroutine inside the route handler lambda as follows: private suspend fun createRoutes(router: Router, auth: OAuth2Auth): Unit { val oauth2 = OAuth2AuthHandler.create(vertx, auth) val authz = KeycloakAuthorization.create() router.route().handler(LoggerHandler.create()) router.route("/api/*").handler(oauth2) router.route("/api/greet").handler { println(RoleBasedAuthorization.create("ad-admins").match(it.user())) authz.getAuthorizations(it.user()).await() } } The compiler

Is it possible to avoid serialization when using the Vert.x eventbus 'locally' (java, single jvm)?

孤人 提交于 2020-12-30 06:48:07
问题 My case is: single JVM Java only (i don't need to be polyglot) I don't want to pay serialization costs to publish an immutable event on the bus (publishing the reference to the java object would work). I understand the scope of the vert.x event bus is much broader than my use case. I had in mind a behaviour similar to akka: when you go distributed you have to provide serialization for your messages, if you stay local references get passed. Is there anything that would allow me to do that in

Is it possible to avoid serialization when using the Vert.x eventbus 'locally' (java, single jvm)?

拜拜、爱过 提交于 2020-12-30 06:46:16
问题 My case is: single JVM Java only (i don't need to be polyglot) I don't want to pay serialization costs to publish an immutable event on the bus (publishing the reference to the java object would work). I understand the scope of the vert.x event bus is much broader than my use case. I had in mind a behaviour similar to akka: when you go distributed you have to provide serialization for your messages, if you stay local references get passed. Is there anything that would allow me to do that in

io.vertx.mysqlclient.MySQLPool.query (“”).execute is never really executed and return nothing

泄露秘密 提交于 2020-12-13 03:32:36
问题 I am trying a very simple tentative to insert and select to/from MySql using vertx for the first time. It is funny to me that I can build and debug the application but I never get either ar.succeeded or failed. How to execute the insert and select bellow? Do I have to enclose somehow client.query and subscribe it? I am complete stuck. All examples on internet I see follow this approach. package com.mybank import io.vertx.kotlin.mysqlclient.mySQLConnectOptionsOf import io.vertx.kotlin

io.vertx.mysqlclient.MySQLPool.query (“”).execute is never really executed and return nothing

穿精又带淫゛_ 提交于 2020-12-13 03:32:27
问题 I am trying a very simple tentative to insert and select to/from MySql using vertx for the first time. It is funny to me that I can build and debug the application but I never get either ar.succeeded or failed. How to execute the insert and select bellow? Do I have to enclose somehow client.query and subscribe it? I am complete stuck. All examples on internet I see follow this approach. package com.mybank import io.vertx.kotlin.mysqlclient.mySQLConnectOptionsOf import io.vertx.kotlin

Behaviour of Vert.x Event-bus when reaching the limit

我们两清 提交于 2020-12-13 03:26:12
问题 I'm missing one piece of understanding of how Event Bus / Hazelcast works. Imagine a case with a consumer and a producer verticles communicating over the clustered EB. The consuming part is doing CPU / memory / IO-intensive calculations. When at some point due to the load the consumer is not able to handle the messages immediately, what is going to happen? Would the messages be queueed inside the ring-buffer and eventually be processed later (considering Netty's SingleThreadEventLoop limits

Behaviour of Vert.x Event-bus when reaching the limit

廉价感情. 提交于 2020-12-13 03:23:32
问题 I'm missing one piece of understanding of how Event Bus / Hazelcast works. Imagine a case with a consumer and a producer verticles communicating over the clustered EB. The consuming part is doing CPU / memory / IO-intensive calculations. When at some point due to the load the consumer is not able to handle the messages immediately, what is going to happen? Would the messages be queueed inside the ring-buffer and eventually be processed later (considering Netty's SingleThreadEventLoop limits

How to use a list as a parameter source for SQL queries with Vertx JDBC Client?

六月ゝ 毕业季﹏ 提交于 2020-12-12 06:41:08
问题 I have a Vert.x web application that needs to query an AWS RDS instance running Postgres 10.7. The Vert.x JDBC client is io.vertx:vertx-jdbc-client:3.8.4 . I want to query a table with the constraint that a certain column's value is included in a set of values: select from table where column in/any (?) I followed the Vertx documentation, which says to create a JsonArray and populate it with the values to inject into the query. The column is of type text and the list that I want to match on is