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.

Header Propagation does not work when using Asynchronous Rest Clients

See original GitHub issue

Describe 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

Archive.zip

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:

  1. Open the attached project and run it. Put a breakpoint inside the HeaderPropagator
  2. GET http://0.0.0.0:8080/hello. The breakpoint will get hit, the containerRequestHeaders will be full of your browser’s headers.
  3. GET http://0.0.0.0:8080/hello/async or http://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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:44 (38 by maintainers)

github_iconTop GitHub Comments

1reaction
jdussouillezcommented, Sep 22, 2022

@geoand I will work on this and try to provide you the smallest project to reproduce next week.

0reactions
geoandcommented, Sep 22, 2022

Do you have a sample application we can check to see the problem in action?

Read more comments on GitHub >

github_iconTop 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 >

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