I'm looking in the documentation, but I cannot find any information. I have a HTTP request where I can easily get the user from the context.
router.get("/politrons/users").handler(routingContext -> {
User user = routingContext.user();
user.isAuthorised("read", res -> {
boolean hasPermission = res.result();
if (hasPermission) {
mongo.find("users", new JsonObject(), getUsersAsyncResultHandler(routingContext));
} else {
routingContext.fail(403); // Failed creation
}
});
});
But also I'm using event bus for other transactions.
eb.consumer(FIND_USER_SERVER).handler(message -> {
eb.send(UserMongoWorker.MONGO_FIND_USER, message.body(), res -> {
message.reply(getResult(res));
});
});
My question is: how can I get the User from the event bus? Just as I do from the routingContext?