@ServerRequestFilter with Uni<Void> signature hangs the request in resteasy reactive #31040
Unanswered
ichrist-gr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I'm using resteasy reactive with all the jax-rs endpoints running on the event loop. In my case i have registered a request filter which checks a mongo database. In this filter, i need to have the request body available. To retrieve the request body, i use the io.vertx.core.http.HttpServerRequest and everything works fine if the filter is implemented with the classic jax-rs way(implements ContainerRequestFilter, @Provider, void filter(ContainerRequestContext) etc..).
But since i have a blocking action that takes place in my filter (access to mongodb), the jax-rs way filter aborts the processing and proceeds to the next filter. It is important to note here, that i can retrieve the request body and also the request to mongo is successful. It's only that i get a response from mongodb after 2 seconds and as a result the next filter is going to be executed.
So i tried the @ServerRequestFilter which returns Uni so that the execution inside the filter completes and then proceed to the next filter. But when i try to read the request body, the request hangs and never completes.
Finally, i tried to use the filter from reactive routes, but since this code will be included in inhouse libraries, some contextual objects from jax-rs are necessary (ResourceInfo, SecutrityContext etc).
Is there a viable solution to this problem?
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions