Header Propagation does not work when using Asynchronous Rest Clients
See original GitHub issueDescribe the bug
Rest Client Header Propagation does not work when using Asynchronous Rest Clients. I have created a small sample which reproduces the problem with Quarkus 0.23.2, with both CompletionStage
and Single
Expected behavior
When using Single
or CompletionStage
in the REST clients’ responses, it seems that the header propagation does not work.
Actual behavior
when HeaderPropagator
is called, the container request headers are empty.
To Reproduce Steps to reproduce the behavior:
- Open the attached project and run it. Put a breakpoint inside the
HeaderPropagator
- GET
http://0.0.0.0:8080/hello
. The breakpoint will get hit, thecontainerRequestHeaders
will be full of your browser’s headers. - GET
http://0.0.0.0:8080/hello/async
orhttp://0.0.0.0:8080/hello/single
. The same array will be empty.
I have also included all necessary libraries as instructred here https://quarkus.io/guides/context-propagation-guide and had the same results. Header propagation only works in synchronous mode.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:44 (38 by maintainers)
Top Results From Across the Web
Header propagation using ASP.NET Core - Craft Bakery
Imagine that you have REST API that calls external REST API. And you have to propagate requested HTTP headers to external API.
Read more >c# - .net core 5 AddHeaderPropogation not forwarding ...
AddHeaderPropagation (), WITHOUT arguments, will default to propagating every Header item, unmodified and anonymously, into the next request.
Read more >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 >Synchronous and asynchronous REST clients - Open Liberty
REST clients can be implemented either synchronously or asynchronously. A synchronous client constructs an HTTP structure, sends a request, and waits for a ......
Read more >Web API implementation - Best practices for cloud applications
A carefully designed RESTful web API defines the resources, relationships, ... If the client does not specify an Accept header, then use a ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@geoand I will work on this and try to provide you the smallest project to reproduce next week.
Do you have a sample application we can check to see the problem in action?