From a4c394c9950048ae6235cf9df92831f7f0eaf361 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 12 Jul 2024 17:51:47 +0530 Subject: [PATCH] fix: Buffer size error with DSL migration calls (#34905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **/test sanity** > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 954c3e7776b0c28524f4e0a521f05d1497589bbb > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Fri, 12 Jul 2024 12:00:55 UTC --- .../main/java/com/appsmith/server/helpers/RTSCaller.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RTSCaller.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RTSCaller.java index c5c2711584..d005ecb032 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RTSCaller.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RTSCaller.java @@ -8,6 +8,7 @@ import org.springframework.http.MediaType; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.netty.http.client.HttpClient; @@ -28,6 +29,8 @@ public class RTSCaller { @Value("${appsmith.rts.port:}") private String rtsPort; + private static final int MAX_IN_MEMORY_SIZE_IN_BYTES = 16 * 1024 * 1024; + @PostConstruct private void makeWebClient() { if (isEmpty(rtsPort)) { @@ -45,6 +48,9 @@ public class RTSCaller { // We do NOT use `WebClientUtils` here, intentionally, since we don't allow connections to 127.0.0.1, // which is exactly the _only_ host we want to hit from here. webClient = WebClient.builder() + .exchangeStrategies(ExchangeStrategies.builder() + .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(MAX_IN_MEMORY_SIZE_IN_BYTES)) + .build()) .clientConnector(new ReactorClientHttpConnector(HttpClient.create(connectionProvider))) .baseUrl("http://127.0.0.1:" + rtsPort) .build();