Skip to content

How to add a Servlet filter in Vert.x REST API?

I have a REST API which was created purely using Vert.x, I would like to instrument it for AWS X-RAY and in order to do that I need to add a servlet filter. I’m creating a webserver like this:

      .requestHandler(r -> r.response().end("Welcome to Vert.x Intro");
      .listen(config().getInteger("http.port", 9090), 
        result -> {
          if (result.succeeded()) {
          } else {

In the documentation for AWS X-RAY they’ve only mentioned Tomcat ( Would adding filters using web.xml work for this as well or do I need to do something different?


I think AWS X-Ray will not work with vert.x – I found no mention of them being used together.

I would probably try to apply spring example from their site but according to these answers it might be in vain. It seems vert.x architecture is not compatible with X-Ray.