Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3613

Add RoutingContext to ResteasyContext in vertx RequestDispatcher

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 6.2.12.Final
    • Vert.X integration
    • None

      At the moment it is exceedingly difficult to get custom data from the Vert.x side to the JAX-RS side.
      There is no reliable, accessible context store that can have things assigned to it on the Vert.x side that can then be accessed on the JAX-RS side.
      This is exacerbated by the need by the JAX-RS side to access the message body, which means that the actual processing on the JAX-RS side is usually on a different thread from that which received the request on the vertx side.

      Currently there are a few things added to the ResteasyContext, but non of them are both per-request and capable of storing more information:
                      ResteasyContext.pushContext(SecurityContext.class, securityContext);
                      ResteasyContext.pushContext(Context.class, context);
                      ResteasyContext.pushContext(HttpServerRequest.class, req);
                      ResteasyContext.pushContext(HttpServerResponse.class, resp);
                      ResteasyContext.pushContext(Vertx.class, context.owner());

      Unfortunately it's not trivial to add the RoutingContext because RequestDispatcher.service is called from VertxRequestHandler.handle but VertxRequestHandler is a Handler<HttpServerRequest> and doesn't have direct access to RoutingContext.

              jperkins-rhn James Perkins
              Yaytay James Talbut (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: