Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit 648a080

Browse files
boyan-velinovnictas
authored andcommitted
Increase maxInMemorySize for WebClient
Jira: LMCROSSITXSADEPLOY-2247
1 parent 9c4a86d commit 648a080

File tree

1 file changed

+8
-1
lines changed
  • src/main/java/com/sap/cloudfoundry/client/facade/util

1 file changed

+8
-1
lines changed

src/main/java/com/sap/cloudfoundry/client/facade/util/RestUtil.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.cloudfoundry.reactor.ConnectionContext;
1010
import org.springframework.http.client.reactive.ClientHttpConnector;
1111
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
12+
import org.springframework.web.reactive.function.client.ExchangeStrategies;
1213
import org.springframework.web.reactive.function.client.WebClient;
1314

1415
import com.sap.cloudfoundry.client.facade.oauth2.OAuthClient;
@@ -24,6 +25,8 @@
2425
*/
2526
public class RestUtil {
2627

28+
private static final int MAX_IN_MEMORY_SIZE = 1 * 1024 * 1024; // 1MB
29+
2730
public OAuthClient createOAuthClient(URL authorizationUrl, boolean trustSelfSignedCerts) {
2831
return new OAuthClient(authorizationUrl, createWebClient(trustSelfSignedCerts));
2932
}
@@ -34,7 +37,11 @@ public OAuthClient createOAuthClient(URL authorizationUrl, boolean trustSelfSign
3437
}
3538

3639
public WebClient createWebClient(boolean trustSelfSignedCerts) {
37-
return WebClient.builder()
40+
return WebClient.builder().exchangeStrategies(ExchangeStrategies.builder()
41+
.codecs(configurer -> configurer
42+
.defaultCodecs()
43+
.maxInMemorySize(MAX_IN_MEMORY_SIZE))
44+
.build())
3845
.clientConnector(buildClientConnector(trustSelfSignedCerts))
3946
.build();
4047
}

0 commit comments

Comments
 (0)