I've implemented a Post filter in the spring cloud gateway. But I need the readable format (JSON Format of response body) before sending it to UI.
I'm getting exchange.getResponse(). (when i printed in console: org.springframework.http.server.reactive.ReactorServerHttpResponse@3891d61a) But it is in the reactive object. I can't able to see the actual original response which is coming from API to post filter. I've searched numerous stackoverflow topics but couldn't get an actual solution. Please assist...
How to get Original response body in Spring cloud gateway (Webflux) Post filter
13.3k Views Asked by Dev-eloper At
2
There are 2 best solutions below
0
nobjta_9x_tq
On
https://github.com/einsteinarbert/spring-webfux-response-logging Beware about Security Chain, maybe that filter will override your filter.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in SPRING-BOOT
- Timing Issue with Spring Boot Annotation Configuration
- LightAdmin - Customise parsing DateTime with app timezone
- Creating distribution with repackaged spring boot jar using gradle application plugin
- Spring Boot MVC non-role based security
- Add JVM args to spring boot application
- The method and() is undefined for the type HttpSecurity
- swagger ui not working for swagger version 2
- Spring IO Platform 2.0 - Themes/Changes?
- JPA findDistinctPropertyBy magic method doesn't work as expected when using spring-boot-starter-jpa
- Spring boot check external service status on boot
- Running a specific spring batch job amongst several jobs contained withing a spring boot fat jar
- Adding security to rest api service built with Spring Boot app
- Spring Redirecting from Http to Https Breaks Rest Controller Test
- Service not starting using Spring-boot during integration tests
- Spring Boot Actuator Health Returning DOWN
Related Questions in SPRING-CLOUD-GATEWAY
- Why Swagger UI sends OPTIONS request method instead of correct one, once i access to it through spring Gateway?
- How use code to configure Spring cloud gateway supported GatewayFilter like SecureHeaders
- Modifying Spring Cloud Gateway routes at runtime
- Should Kubernetes Ingress lives together with a Spring Cloud Gateway?
- Spring cloud load balancer with Spring Cloud gateway
- Change Configuration from Ribbon to Spring Cloud Load Balancer in spring cloud gateway
- Is there a way to apply a filter or code BEFORE routing (Spring Cloud Gateway)
- Spring Cloud Gateway - Unable to find GatewayFilterFactory with name [Filter_Name]
- spring cloud gateway mapping for different url
- Automate Spring Security Service Account Login
- Spring Cloud Gateway: javax.net.ssl.SSLHandshakeException: No available authentication scheme
- Netty server boss and worker thread pool sizes
- Spring Cloud Gateway serving both Frontend service(s) as well as Backend service(s) in an OAuth2 Spring security setup
- Spring Cloud Gateway Custom Exception Handling
- How to get response body in Spring Gateway
Related Questions in GLOBAL-FILTER
- Logging in Asp.net MVC application using log4net
- Conditional filter: Only for controllers that inherit from baseController and is a post)
- Query string for Global Filter in ASP.NET Core MVC
- Create a global filter in ASP.NET Core 8 MVC
- How to apply Global ActionFilter to all controllers and return Result?
- LinqToDB.EntityFrameworkCore IgnoreFilters() does not disable global filters on some queries
- How to get Original response body in Spring cloud gateway (Webflux) Post filter
- Restricted Attribute did not register in Startup.Cs
- EntityFramework.Filters - Filter expression with join to another table
- PrimeNg GlobalFilter : Stop searching after finding match in first column (Not looking for values in subsequent columns)
- MVC global filter to load/maintain menus from database on page load
- Save visitors data before returning any view with Laravel
- Facing issue while trying to log request using ServerHttpRequestDecorator in Filter
- Hi I need help in making a global product attribute selector having pop up feature in wordpress, would be glad if anyone can suggest anything
- System.InvalidOperationException: Variable '' of type '' referenced from scope '', but it is not defined
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
you can extract/read/modify/manipulate the request and response and their headers with the help of
ServerHttpRequestDecorator&ServerHttpResponseDecoratorsee belowNote: i implemented GatewayFilter because i have this logic in gateway service level, if you want to modify at micro service level you can use WebFilter