question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resteasy-reactive and rest-client: propagation of headers doesn't work

See original GitHub issue

Describe the bug

Hi, I have a production project using quarkus-resteasy(-jsonb) and quarkus-rest-client.

I wanted to give a try to the new quarkus-resteasy-reactive(-jsonb) extension so I replaced quarkus-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 the org.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 the incomingHeaders 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

# Add your application.properties here, if applicable.
org.eclipse.microprofile.rest.client.propagateHeaders=Authorization

Environment (please complete the following information):

Output of uname -a or ver

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 or gradlew --version)

mvn 3.6.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:26 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Jul 13, 2022

I am going to close this as this works properly when using RESTEasy Reactive and the Reactive REST Client

1reaction
Faboli7commented, Apr 7, 2021

Ok @geoand, I’ll do that. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the REST Client Reactive - Quarkus
If you make a REST client call from a REST resource, this factory will propagate all the headers listed in org.eclipse.microprofile.rest.client.propagateHeaders ...
Read more >
Reactive rest client headers injection in Quarkus
In the Custom headers support section it's introduced the ClientHeadersFactory interface to allow injecting headers in a request, but you are ...
Read more >
RESTEasy JAX-RS - JBoss.org
Used when the client is unable to use an Accept header to choose a representation (i.e. a browser). See Chapter 19, JAX-RS Content...
Read more >
Chapter 2. Developing JAX-RS Web Services
JBoss EAP does not support the resteasy-crypto , resteasy-yaml-provider , and ... with JBoss EAP for working examples that use the RESTEasy client...
Read more >
Distributed Logs with Quarkus - Google Groups
Problem : Both OpenTracing and OpenTelemetry extensions provided by ... calling REST Client Reactive with current traceId propagation (is it working?)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found