I have a simple gateway, that routing requests to different endpoints depending on the request body content
@Bean
fun billingRoute(builder: RouteLocatorBuilder): RouteLocator {
return builder.routes()
.route("test-route") { predicateSpec ->
predicateSpec
.path(<...>)
.readBody(MessageDto::class.java) {
<...>
}
.uri(<...>)
}
During filtering request body caches and can be accessed in exchange object by ServerWebExchangeUtils.CACHED_REQUEST_BODY_ATTR and "cachedRequestBodyObjects" keys.
Am I need to manually release content of these DataBuffers after the body processing to avoid memory leaks (i heard that it was necessary when using CacheRequestBody gateway filter earlier), or at the end of the chain it releases automatically?
Thanks for your answer