Add config property for webflux codec maxInMemorySize

This commit creates a new configuration property
`spring.codec.max-in-memory-size` which configures the maximum
amount of data to be buffered in memory by codecs (both client and
server).

This property has no default value - it will let Spring Framework handle
the default behavior, currently enforcing a 256KB for provided codecs.

Fixes gh-18828
This commit is contained in:
Brian Clozel
2019-10-31 16:42:14 +01:00
parent 2d0a235c52
commit b7f59eb7cb
6 changed files with 98 additions and 12 deletions

View File

@@ -2538,8 +2538,9 @@ If you want to take complete control of Spring WebFlux, you can add your own `@C
Spring WebFlux uses the `HttpMessageReader` and `HttpMessageWriter` interfaces to convert HTTP requests and responses.
They are configured with `CodecConfigurer` to have sensible defaults by looking at the libraries available in your classpath.
Spring Boot applies further customization by using `CodecCustomizer` instances.
For example, `spring.jackson.*` configuration keys are applied to the Jackson codec.
Spring Boot provides dedicated configuration properties for codecs, `+spring.codec.*+`.
It also applies further customization by using `CodecCustomizer` instances.
For example, `+spring.jackson.*+` configuration keys are applied to the Jackson codec.
If you need to add or customize codecs, you can create a custom `CodecCustomizer` component, as shown in the following example:
@@ -2554,7 +2555,7 @@ If you need to add or customize codecs, you can create a custom `CodecCustomizer
public CodecCustomizer myCodecCustomizer() {
return codecConfigurer -> {
// ...
}
};
}
}

View File

@@ -24,7 +24,7 @@ def generateConfigMetadataDocumentation() {
builder
.addSection("core")
.withKeyPrefixes("debug", "trace", "logging", "spring.aop", "spring.application",
"spring.autoconfigure", "spring.banner", "spring.beaninfo", "spring.config",
"spring.autoconfigure", "spring.banner", "spring.beaninfo", "spring.codec", "spring.config",
"spring.info", "spring.jmx", "spring.main", "spring.messages", "spring.pid",
"spring.profiles", "spring.quartz", "spring.reactor", "spring.task",
"spring.mandatory-file-encoding", "info", "spring.output.ansi.enabled")