To sort of answer my question, most probably I was not in the right direction. The best way would be to do something similar as the BodyHandler. - as indicated in the blog post
http://vertx.io/blog/some-rest-with-vert-x/ So I created my base handler that sets always the content type or other stuff, I would like to have for most of my routes / resources
public class BaseHandler implements Handler<RoutingContext>{
@Override
public void handle(RoutingContext context) {
HttpServerResponse response = context.response();
response.putHeader(HttpHeaders.CONTENT_TYPE.toString(), "application/json");
//other stuff!
response.setChunked(true);
context.next();
}
}
And in my Verticle I register my base handler - overall
@Override
public void start(Future<Void> fut) {
HttpServer server = vertx.createHttpServer();
Router router = Router.router(vertx);
//register the base handler to do basic stuff
router.route().handler(new BaseHandler());
router.route("/status/").handler(new StatusHandler());
router.route("/users/").handler(new UsersHandler());
router.route("/products/").handler(new ProductsHandler());
server.requestHandler(router::accept).listen(8080);
}
Thanks