我尝试使用Vertx编写Web API以服务于大用户。
@Override
public Router router(Vertx vertx) {
Router router = Router.router(vertx);
router.route().handler(BodyHandler.create());
router.post("/").handler(this::productionF);
return router;
}
private void productionF(RoutingContext routingContext) {
// check input
// read data from redis
// response
}
但是,现在,我想将此API移到异步过程中以获得高性能。我尝试使用EventBus,但不起作用。
有人对此有任何想法或实验吗?