Skip to content

Commit

Permalink
fix: Exceeded limit on max bytes to buffer (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
mycxu authored Nov 4, 2024
1 parent 5e8921d commit 0248417
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 0248417

Please sign in to comment.