-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resteasy-reactive and rest-client: propagation of headers doesn't work #16059
Comments
@michalszynkiewicz would you like to look into this? |
@geoand there's clearly some conflict between resteasy and resteasy-reactive. Users have reported such things in a few other places too, IIRC. |
Well, ideally we would. Practically, if there is something simple we can do to separate stuff without too much effort, that would be nice. Otherwise we need to start making it very clear in docs (and perhaps a warning during the build), that users should use the new client. |
Won't there be issues with all the JAX-RS providers if we have both on the ClassPath? |
I thought this issue was only about |
I'd rather we kept the RR and RestEasy classic worlds separate... @Faboli7 would using rest-client-reactive be an option for you? The API is the same, nearly all features are covered. The drawback is that rest-client-reactive has just been added in Quarkus 1.13 so may be more buggy, and, until the quarkus platform is released, you'd have to use Even if it works for you, please don't close this issue, as @geoand wrote we should either make quarkus-rest-client work with resteasy reactive or warn users not to. |
Hi all and thanks for your replies. @michalszynkiewicz The reasons why I used quarkus-rest-client is because I was already using it in my project and according to this paragraph it was supposed to work, and according to the second part of this paragraph, there was no alternative at the time of this article (except using quarkus-jaxrs-client but I don't want to), and still not in quarkus 1.12. So I guess I'll wait for quarkus 1.13 to start testing the migration. Not a big deal. |
Hi, I tried again with quarkus 1.13 and the new rest client extension but now I have issues with timeouts when I call external services. Here is the partial stacktrace:
I'm not using async calls and I thought the issue might come from that so I tried to add Any idea what's the issue ? I'm not very familiar with reactive programming (know the concept, never used it) so I might miss something but if I'm not mistaken, with this new extension we can still decide to use imperative or reactive pattern, am I right? |
There are some enhancements coming in |
Ok @geoand, I'll do that. Thanks. |
I am going to spend some time preparing an example that reproduces strange behavior that I found out after migration from 1.9.2 to 1.13.
But now after moving on 1.13 I found out that it is required to wrap any calls of rest client to context propagation. Also It gets required to wrap static methods |
An example would be great, thanks |
@geoand I prepared an example |
Thanks |
@geoand maybe it's better to create a separate ticket? I think it does not matter which is the environment. |
What do you mean exactly? |
Sorry for my English. I mean It makes no difference if it is Windows or not. I checked cases in a docker container. The result was the same. But I can see labels on this ticket. ... And I mixed up the words "issue" in github's terms with "ticket" |
Understood, thanks! I'll hopefully take a look at this soon |
It looks like @michalszynkiewicz any idea what is going on? |
@geoand: I experienced the same issue. Luckily with 1.13.4 and the tipp to use the rest-client-reactive it worked for me. Unfortunately, I wasn't able to find the I think it could help others to improve the docs in this regard. Maybe add the segment about the reactive rest client also to the standard rest client documentation documentation and maybe write something about it in the getting started reactive guide. Thanks for all your efforts! |
Thank you for the input @andreas-eberle! @michalszynkiewicz how do you feel about the proposed improvements? |
Adding info to the docs? 👍🏻 |
@andreas-eberle would you like to contribute that? |
As for the problem I described above with Context Propagation, RestEasy, and CF #17486 |
I am going to close this as this works properly when using RESTEasy Reactive and the Reactive REST Client |
Describe the bug
Hi, I have a production project using
quarkus-resteasy(-jsonb)
andquarkus-rest-client
.I wanted to give a try to the new
quarkus-resteasy-reactive(-jsonb)
extension so I replacedquarkus-resteasy-jsonb
by this one in my pom.Everything compiles without any change to the code or config and the app starts without error but I noticed that the headers are not propagated from my endpoints to the rest clients anymore.
For headers propagation I use the
DefaultClientHeadersFactoryImpl
(by annotating my clients with@RegisterClientHeaders
) with theorg.eclipse.microprofile.rest.client.propagateHeaders
property.EDIT: I tried to implement the behavior myself with a custom
ClientHeadersFactory
, but the header is also null in theincomingHeaders MultivaluedMap
.From my readings of this blog article, I assume that resteasy-reactive and rest-client should be compatible (and except this issue, it seems to work), so it looks like a bug.
Expected behavior
The headers that are part of the original request should be propagated to the rest client, like it was the case with quarkus-resteasy.
Actual behavior
The headers are not propagated.
To Reproduce
I could create a small reproducer but it doesn't seem necessary as I'm just using standard behavior. If you disagree, let me know and I'll add one.
Configuration
Environment (please complete the following information):
Output of
uname -a
orver
Linux and Windows
Output of
java -version
openjdk version "11.0.7" 2020-04-14 LTS
OpenJDK Runtime Environment 20.4-(Zulu-11.39+15-win_x64)-Microsoft-Azure-restricted (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 20.4-(Zulu-11.39+15-win_x64)-Microsoft-Azure-restricted (build 11.0.7+10-LTS, mixed mode)
GraalVM version (if different from Java)
Not using native builds
Quarkus version or git rev
1.12.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn 3.6.3
The text was updated successfully, but these errors were encountered: