From 10486f3595383f6aeef049fa6d875cfbdee79259 Mon Sep 17 00:00:00 2001 From: mycxu <836549522@qq.com> Date: Thu, 31 Oct 2024 21:18:48 +0800 Subject: [PATCH] fix: Exceeded limit on max bytes to buffer --- .../jifa/server/service/impl/WorkerServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java b/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java index 9552f525..689d69bb 100644 --- a/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java +++ b/server/src/main/java/org/eclipse/jifa/server/service/impl/WorkerServiceImpl.java @@ -65,6 +65,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.reactive.function.BodyInserter; import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.web.util.DefaultUriBuilderFactory; @@ -127,7 +128,13 @@ protected WorkerServiceImpl(UserService userService, .doOnConnected(conn -> conn .addHandlerLast(new ReadTimeoutHandler(Long.MAX_VALUE, TimeUnit.SECONDS)) .addHandlerLast(new WriteTimeoutHandler(Long.MAX_VALUE, TimeUnit.SECONDS))); + + final int maxInMemorySize = 10 * 1024 * 1024; + final ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder() + .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(maxInMemorySize)) + .build(); webClient = WebClient.builder() + .exchangeStrategies(exchangeStrategies) .clientConnector(new ReactorClientHttpConnector(httpClient)) .build();