vert.x

How can I send RoutingContext object from routing verticle to some other verticle using vertx.eventBus().send() method?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 14:51:22
问题 From my routing verticle which has route URL, I want to send RoutingContext object to another verticle. I believe we can only use vertx.eventBus().send() to send message from routing verticle to some other action verticle. Can I send RoutingContext object as a message? In router verticle I am doing vertx.eventBus().<RoutingContext>send("address", routingContext) and in consumer verticle I am doing vertx.eventBus().<RoutingContext>consumer("address").handler(message -> { RoutingContext

How can I send RoutingContext object from routing verticle to some other verticle using vertx.eventBus().send() method?

江枫思渺然 提交于 2021-02-11 14:50:30
问题 From my routing verticle which has route URL, I want to send RoutingContext object to another verticle. I believe we can only use vertx.eventBus().send() to send message from routing verticle to some other action verticle. Can I send RoutingContext object as a message? In router verticle I am doing vertx.eventBus().<RoutingContext>send("address", routingContext) and in consumer verticle I am doing vertx.eventBus().<RoutingContext>consumer("address").handler(message -> { RoutingContext

Nullpointer exception when trying to receive UDP multicast

只愿长相守 提交于 2021-02-09 07:01:38
问题 i'm puzzeled after a few attempts to get a simple UDP multicast receiver working. After my own code did not work as expected i tried out the exact example posted in the vertx documentation: DatagramSocket socket = vertx.createDatagramSocket(new DatagramSocketOptions()); socket.listen(1234, "0.0.0.0", asyncResult -> { if (asyncResult.succeeded()) { socket.handler(packet -> { // Do something with the packet }); // join the multicast group socket.listenMulticastGroup("230.0.0.1", asyncResult2 ->

Vertx web-server uses only one event-loop thread while 16 are available

▼魔方 西西 提交于 2021-02-08 13:44:16
问题 I use Vert.x v3.5.1. There is the simplest sample of code: vertx.createHttpServer() .requestHandler(anyRouter::accept) .listen(8080); In my case the event loop group size is 16 so I expect that my requests will affect 16 threads. Server is started succesfully but it works only in one thread . (I sent request using different tcp-connections so keep-alive is not a reason here.) Class HttpServerImpl contains httpHandlerMgr and this manager handles a pool of event loops (named availableWorkers ).

Vertx connection timeout not catched JDBCClient (.getConnection)

风格不统一 提交于 2021-02-07 20:36:31
问题 I can't handle case when connection failed in JDBCClient, example: no host to route, connection time out and etc. Because the method .getConnection() is not return failedFuture but it show cause in monitor then it's will silence. I think it should send the fail future more than print error log when connection time out or other cause. My example code is. JDBCClient client = ...; client.getConnection(conn -> { if (conn.succeeded()) { .... } else { // This is never executed (connection time out

Vertx connection timeout not catched JDBCClient (.getConnection)

爱⌒轻易说出口 提交于 2021-02-07 20:36:15
问题 I can't handle case when connection failed in JDBCClient, example: no host to route, connection time out and etc. Because the method .getConnection() is not return failedFuture but it show cause in monitor then it's will silence. I think it should send the fail future more than print error log when connection time out or other cause. My example code is. JDBCClient client = ...; client.getConnection(conn -> { if (conn.succeeded()) { .... } else { // This is never executed (connection time out

Vertx connection timeout not catched JDBCClient (.getConnection)

血红的双手。 提交于 2021-02-07 20:36:01
问题 I can't handle case when connection failed in JDBCClient, example: no host to route, connection time out and etc. Because the method .getConnection() is not return failedFuture but it show cause in monitor then it's will silence. I think it should send the fail future more than print error log when connection time out or other cause. My example code is. JDBCClient client = ...; client.getConnection(conn -> { if (conn.succeeded()) { .... } else { // This is never executed (connection time out

Streaming S3 object to VertX Http Server Response

核能气质少年 提交于 2021-02-06 14:01:01
问题 The title basically explains itself. I have a REST endpoint with VertX . Upon hitting it, I have some logic which results in an AWS-S3 object. My previous logic was not to upload to S3 , but to save it locally. So, I can do this at the response routerCxt.response().sendFile(file_path...) . Now that the file is in S3, I have to download it locally before I could call the above code. That is slow and inefficient. I would like to stream S3 object directly to the response object. In Express , it

Streaming S3 object to VertX Http Server Response

孤人 提交于 2021-02-06 13:59:30
问题 The title basically explains itself. I have a REST endpoint with VertX . Upon hitting it, I have some logic which results in an AWS-S3 object. My previous logic was not to upload to S3 , but to save it locally. So, I can do this at the response routerCxt.response().sendFile(file_path...) . Now that the file is in S3, I have to download it locally before I could call the above code. That is slow and inefficient. I would like to stream S3 object directly to the response object. In Express , it

Streaming S3 object to VertX Http Server Response

ⅰ亾dé卋堺 提交于 2021-02-06 13:55:36
问题 The title basically explains itself. I have a REST endpoint with VertX . Upon hitting it, I have some logic which results in an AWS-S3 object. My previous logic was not to upload to S3 , but to save it locally. So, I can do this at the response routerCxt.response().sendFile(file_path...) . Now that the file is in S3, I have to download it locally before I could call the above code. That is slow and inefficient. I would like to stream S3 object directly to the response object. In Express , it