vertx-service-proxy是EventBus代理生成。
示例:
// Assume database service is already deployed somewhere....// Save some data in the databaseJsonObject message = new JsonObject();message.putString("collection", "mycollection");message.putObject("document", new JsonObject().putString("name", "tim"));DeliveryOptions options = new DeliveryOptions().addHeader("action", "save");vertx.eventBus().send("database-service-address", message, options, res2 -> { if (res2.succeeded()) { // done }}
评论