Table of Contents

Vert.x - Rest / Jax-RS

About

Java - Rest with vertx

The problem

Many wrapper libraries (Rest, CDI, …) use a thread-local context so that the user-code method can look them up when executed.

In the case of RESTEasy, the context holds this information:

This works well where you have one thread per request, but stops working if the request:

because the context is not made available in this thread.

The solution are:

JaxRS

Rest Easy as Router

RESTEasy is this case is the router and you can't add a route without it which means that you server is only a rest server.

Reactive Context

reactive-contexts propagates the context to multi-thread allowing resteasy to work.

See also the Redpipe framework that is based in this idea.

Documentation / Reference