Resteasy-reactive : JPA TenantResolver fails with Normal scoped producer method may not return null: io.quarkus.vertx.http.runtime.CurrentVertxRequest #331
If this is a bug (?), maybe the documentation should be updated too to show example of context.
Actual behavior
throws on context.getRequest()
2021-05-01 20:53:11.353 CEST+0200 (executor-thread-1 #80) (GradleWorkerMain pid:411885) org.jboss.resteasy.reactive.server.core.ExceptionMapping ERROR Request failed : javax.enterprise.inject.IllegalProductException: Normal scoped producer method may not return null: io.quarkus.vertx.http.runtime.CurrentVertxRequest.getCurrent()
at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_Bean.create(CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_Bean.zig:178)
at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_Bean.create(CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_Bean.zig:197)
at io.quarkus.arc.impl.RequestContext.getIfActive(RequestContext.java:68)
at io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:33)
at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_ClientProxy.arc$delegate(CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_ClientProxy.zig:60)
at io.quarkus.vertx.http.runtime.CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_ClientProxy.request(CurrentVertxRequest_ProducerMethod_getCurrent_6dc23d16d53ba5c34e1e7b6f54290fd7b9aebd76_ClientProxy.zig:302)
at com.xxxxxxxxxxxxxxx.resolveTenantId(JPATenantResolver.kt:19)
at com.xxxxx.JPATenantResolver_ClientProxy.resolveTenantId(JPATenantResolver_ClientProxy.zig:238)
To Reproduce
see above
Environment (please complete the following information):
Describe the bug
Following https://quarkus.io/guides/hibernate-orm#writing-the-application
Implement a
@RequestScoped
TenantResolver
, inject Vertx routingContext to get access to the request context (path, parameters)Add
@Blocking
to the controller using JPA to let the method run on worker thread and not slow down the event loopthe controller uses
@GET and @Path
, not reactive routes, see belowquery the controller
Expected behavior
Vertx routing context to be accessible when we use resteasy-reactive
I guess it's related to https://github.com/quarkusio/quarkus/issues/13262
I see that https://quarkus.io/guides/reactive-routes exists and has a
RoutingExchange
, but I don't see how to "see" it within theTenantResolver
If this is a bug (?), maybe the documentation should be updated too to show example of context.
Actual behavior
throws on
context.getRequest()
To Reproduce
see above
Environment (please complete the following information):
jdk11 qk 1.13.3
https://github.com/quarkusio/quarkus/issues/16934
$upstream:16934$