use of io.vertx.up.annotations.Address in project vertx-zero by silentbalanceyh.
the class FutureWorker method sayHello.
@Address("ZERO://RPC/SECOND")
public Future<JsonObject> sayHello(final Envelop envelop) {
final String name = Ux.getString(envelop);
final JsonObject params = new JsonObject().put("name", name);
return Ux.thenRpc("ipc-coeus", "RPC://SAY/FUTURE", params);
}
use of io.vertx.up.annotations.Address in project vertx-zero by silentbalanceyh.
the class SingleWorker method sayHello.
@Address("ZERO://RPC/FIRST")
public void sayHello(final Message<Envelop> message) {
final String name = Ux.getString(message);
final JsonObject params = new JsonObject().put("name", name);
this.client.connect("ipc-coeus", "RPC://SAY/HELLO", params, res -> {
if (res.succeeded()) {
message.reply(Envelop.success(res.result()));
} else {
res.cause().printStackTrace();
message.reply(Envelop.failure(res.cause().getMessage()));
}
});
}
use of io.vertx.up.annotations.Address in project vertx-zero by silentbalanceyh.
the class TabularWorker method update.
@Address("ZERO://QUEUE/TABULAR/UPDATE")
Future<JsonObject> update(final Envelop envelop) {
final Long id = Ux.getLong(envelop);
final JsonObject data = Ux.getJson1(envelop);
return this.stub.update(id, data);
}
use of io.vertx.up.annotations.Address in project vertx-zero by silentbalanceyh.
the class JavaStyleWorker method async.
@Address("ZERO://ASYNC/JAVA")
public Envelop async(final Envelop input) {
final String literal = input.data();
final JsonObject data = new JsonObject().put("result", "SUCCESS").put("input", literal);
return Envelop.success(data);
}
use of io.vertx.up.annotations.Address in project vertx-zero by silentbalanceyh.
the class VertxStyleWorker method sayMessage.
@Address("ZERO://ASYNC/VERTX/HANDLER")
public void sayMessage(final Message<Envelop> message) {
final JsonObject data = Ux.getBody(message);
message.reply(Envelop.success(data));
}
Aggregations