vertx-service-proxyEventBus 代理生成
vertx-service-proxy 是 EventBus 代理生成。
示例:
// Assume database service is already deployed somewhere.... // Save some data in the database JsonObject 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 } }
评论