Interesting new filters on Spring Cloud Gateway 4.0
Spring Cloud Gateway 4.0 is finally here! Thanks to our community contributions we have introduced new features and interesting filters.
This blog post details new noteworthy and explains some of the new filters included, how they work and how you can use it to provide more insights into your applications.
First of all, let's talk about cache! Cache is a complicated issue and that's why we have introduced two new filters related to it, but take into account that these filters can make the gateway memory constrained so use them carefully.
CacheRequestBody
Manipulating the request body can cause issues if not done properly, so we made it easy for you; with this filter we offer the possibility to cache the request body before it to the downstream and get that body from an exchange attribute.
It will be available in the ServerWebExchange.getAttributes()
under a key defined in ServerWebExchangeUtils.CACHED_REQUEST_BODY_ATTR
…