Skip to content

Commit

Permalink
Merge pull request #122 from bcgov/develop/alex-GRAD2-2410-2
Browse files Browse the repository at this point in the history
Added threaded webclient into config
  • Loading branch information
kamal-mohammed committed Nov 23, 2023
2 parents 4b749ad + 4ca9169 commit e80a9ae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.ExchangeStrategies;
import org.springframework.web.reactive.function.client.WebClient;
Expand Down Expand Up @@ -37,7 +38,9 @@ public ModelMapper modelMapper() {
public WebClient webClient() {
HttpClient client = HttpClient.create();
client.warmup().block();
return WebClient.builder().exchangeStrategies(ExchangeStrategies.builder()
return WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(HttpClient.newConnection().compress(true)))
.exchangeStrategies(ExchangeStrategies.builder()
.codecs(configurer -> configurer
.defaultCodecs()
.maxInMemorySize(100 * 1024 * 1024))
Expand Down

0 comments on commit e80a9ae

Please sign in to comment.