Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The next sections describes how to set up project configuration.
- `circuitbreaker.closed_state_calls_number` - size of circuit breaker sliding window.
- `circuitbreaker.half_open_state_calls_number` - number of calls in half open state.
- `sampling.rate` - logging sampling rate
- `server.max-http-body-size-kb` - sets max HTTP body size in kb. Default is 256 kb. Improper usage might lead to application running out of memory.

### Storage
- `storage.default-ttl-seconds` - set the default ttl for the data
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/org/prebid/cache/config/BodySizeConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.prebid.cache.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.web.reactive.config.WebFluxConfigurer;

@Configuration
@ConditionalOnProperty(name = "server.max-http-body-size-kb")
public class BodySizeConfig implements WebFluxConfigurer {

@Value("${server.max-http-body-size-kb}")
private int maxHttpBodySizeKb;

@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(maxHttpBodySizeKb * 1024);
}
}
Loading