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
I am looking for enriching the response headers of feign with custom key-value pair through custom ResponseInterceptor class.
However, I am facing UnsupportedOperationException due to UnmodifiableMap.
How do we achieve adding custom response headers with minimal code changes to our microservice?
The text was updated successfully, but these errors were encountered:
First and foremost, Feign is not a replacement or proxy for real HTTP clients. It's meant to reduce boilerplate and simplify integrations with HTTP-like services, so direct modification of Request and Responseinternal objects is intentionally difficult.
With that said, you have two options:
Use a ResponseMapper. This will allow you to mutate the response before decoding, but after intercepting.
Create a custom Client implementation that decorates the original HTTP Response headers before the internal Response object is created.
I am looking for enriching the response headers of feign with custom key-value pair through custom ResponseInterceptor class.
However, I am facing UnsupportedOperationException due to UnmodifiableMap.
How do we achieve adding custom response headers with minimal code changes to our microservice?
The text was updated successfully, but these errors were encountered: