You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I did setup an example project that uses 1 Spring Cloud Gateway app and 1 Spring Boot app. The Spring Cloud Gateway of course, forwards http calls to the Spring Boot app and also uses Micrometer Tracing where I have defined the header with key request-id as remote-field baggage in the application.yml . In addition, Spring Cloud Gateway has a Global Filter where it set's the header itself to a random value.
I have observed that, when calling the 2 services and providing the header explicitly in the http request, the following issue arised in the Spring Boot app where the same header is being logged:
The header value gets stuck and does never changes again, even if we provide another explicit header value in subsequent http calls.
I could identify following Spring features that produce the issue if being used together:
Reactor's context propagation in Spring Cloud Gateway: Hooks.enableAutomaticContextPropagation()
Spring Security in Spring Cloud Gateway
Specifying the header as a Micrometer Tracing Baggage Remote Field
It seems that, if any of the above 3 Spring features is not being used, that the issue stops being present.
I am sorry if the explanation above is difficult to read and understand and if it does not describe the problem very well and clear, but it's a very complex issue that only arises due to some very specific constellation. However the above 3 features are often used in a lot of production apps which makes the issue very relevant.
Sample
You can checkout the sample project here with a short README with the steps needed to reproduce the issue
P.S.
I am not sure if this is the correct place for this issue but to be sure I have opened the issue in this repo too. Please close this if not relevant.
@marcingrzejszczak Yes this issue seems to be fixed. Thank you. Can we link it with any PR or specific change that fixed it so we can guard against possible regressions in the future?
Describe the bug
Hello, I did setup an example project that uses 1 Spring Cloud Gateway app and 1 Spring Boot app. The Spring Cloud Gateway of course, forwards http calls to the Spring Boot app and also uses Micrometer Tracing where I have defined the header with key
request-id
as remote-field baggage in the application.yml . In addition, Spring Cloud Gateway has a Global Filter where it set's the header itself to a random value.I have observed that, when calling the 2 services and providing the header explicitly in the http request, the following issue arised in the Spring Boot app where the same header is being logged:
The header value gets stuck and does never changes again, even if we provide another explicit header value in subsequent http calls.
I could identify following Spring features that produce the issue if being used together:
Hooks.enableAutomaticContextPropagation()
It seems that, if any of the above 3 Spring features is not being used, that the issue stops being present.
I am sorry if the explanation above is difficult to read and understand and if it does not describe the problem very well and clear, but it's a very complex issue that only arises due to some very specific constellation. However the above 3 features are often used in a lot of production apps which makes the issue very relevant.
Sample
You can checkout the sample project here with a short README with the steps needed to reproduce the issue
P.S.
I am not sure if this is the correct place for this issue but to be sure I have opened the issue in this repo too. Please close this if not relevant.
Issue in Spring Cloud Gateway repo: spring-cloud/spring-cloud-gateway#2982
The text was updated successfully, but these errors were encountered: