We are setting spring.codec.max-in-memory-size
and we expect (based on the documentation) that it will change the max possible size for server and client.
I did a check and for the server it does not work - I set it to some small value:
spring:
codec:
max-in-memory-size: 10B
and just call our endpoint with json which is definitely bigger than 10B. It passes because it uses default 256KB. However, when we add custom config like:
@Configuration
public class CustomWebfluxConfiguration implements WebFluxConfigurer {
@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(10);
}
}
then I cannot post to my endpoint json which is bigger than 10B (so exactly what I expect). Why it does not work with the property as well like for the client?
We are using: spring-boot version 2.4.4 Netty server
Comment From: bclozel
Could you provide a sample application demonstrating the issue? Ideally, something we can git clone and run.
Thanks!
Comment From: abialas
I created a sample project with test and what surprised me - it works. I verified difference and the problem lied in the annotation we use EnableWebFlux
which I understand disables WebFluxAutoConfiguration
(where this property is used).
Comment From: bclozel
It looks like you've found where the problem comes from - this behavior is mentioned in the reference documentation.
I'm glad things are working now! Thanks!