Open gsmet opened 2 months ago
/cc @gwenneg (cache)
/cc @geoand too
The use of TemplateInstance
forces Quarkus REST to run your method on the event loop. We made that so a while back, but given that this is not the first time I've seen this issue, I am wondering whether it was the wrong call.
cc @mkouba
Doesn't the use of @Blocking
fix the issue?
@geoand yes that's how I fixed it for now. See:
I worked around it for now by adding a @Blocking annotation to the endpoints.
But it's not an ideal experience. And there is still the question about Multi
as in the case of @CacheInvalidateAll
, it makes sense, I think, as you can point to a named cache that is not the one of the method.
Also, I would expect the code determining if we are reactive or not to at least have a look at the @Blocking
/@NonBlocking
annotations.
Also, I would expect the code determining if we are reactive or not to at least have a look at the @Blocking/@NonBlocking annotations
This is the part I'm not following, care to elaborate please?
The use of
TemplateInstance
forces Quarkus REST to run your method on the event loop. We made that so a while back, but given that this is not the first time I've seen this issue, I am wondering whether it was the wrong call.cc @mkouba
Yep, it was probably a wrong move. We should deprecate the io.quarkus.resteasy.reactive.server.spi.NonBlockingReturnTypeBuildItem
. I'm not so sure if we should just (a) switch the default behavior to TemplateInstance
-> blocking + update migration notes or (b) switch and provide a config property to enable the old behavior (for backrward compatibility).
@geoand WDYT?
We should deprecate the io.quarkus.resteasy.reactive.server.spi.NonBlockingReturnTypeBuildIteμ
Given it's only used in Qute (at least in the core repo), I think we can do this.
or (b) switch and provide a config property to enable the old behavior (for backrward compatibility).
This is probably safer
We should deprecate the io.quarkus.resteasy.reactive.server.spi.NonBlockingReturnTypeBuildIteμ
Given it's only used in Qute (at least in the core repo), I think we can do this.
or (b) switch and provide a config property to enable the old behavior (for backrward compatibility).
This is probably safer
Ok, I will send a PR later today.
I have the following endpoint using Quarkus REST (I was trying to update from RESTEasy Classic):
Note the
TemplateInstance
return type.When I load this resource, I get:
Which seems in line with the code in
CacheInvalidateAllInterceptor
:AFAICS, Quarkus REST decides to make the endpoint reactive and
CacheInvalidateAllInterceptor
decides that it's blocking and thus there's a mismatch in behavior.I'm a bit unsure how we should fix this. I'm also surprised that we don't consider the
@Blocking
/@NonBlocking
annotations in this code. And same question for handlingMulti
?I worked around it for now by adding a
@Blocking annotation
to the endpoints.