use of org.springframework.http.client.reactive.ReactorClientHttpConnector in project spring-boot by spring-projects.
the class AbstractReactiveWebServerFactoryTests method getWebClient.
protected WebClient.Builder getWebClient(HttpClient client, int port) {
InetSocketAddress address = new InetSocketAddress(port);
String baseUrl = "http://" + address.getHostString() + ":" + address.getPort();
return WebClient.builder().clientConnector(new ReactorClientHttpConnector(client)).baseUrl(baseUrl);
}
use of org.springframework.http.client.reactive.ReactorClientHttpConnector in project spring-boot by spring-projects.
the class AbstractReactiveWebServerFactoryTests method buildTrustAllSslConnector.
protected ReactorClientHttpConnector buildTrustAllSslConnector() {
Http11SslContextSpec sslContextSpec = Http11SslContextSpec.forClient().configure((builder) -> builder.sslProvider(SslProvider.JDK).trustManager(InsecureTrustManagerFactory.INSTANCE));
HttpClient client = HttpClient.create().wiretap(true).secure((spec) -> spec.sslContext(sslContextSpec));
return new ReactorClientHttpConnector(client);
}
use of org.springframework.http.client.reactive.ReactorClientHttpConnector in project JavaForFun by gumartinm.
the class ServicesConfig method webClientBuilder.
@Bean
public WebClient.Builder webClientBuilder() {
ClientHttpConnector connector = new ReactorClientHttpConnector(options -> {
options.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectionTimeOut).onChannelInit(channel -> {
channel.pipeline().addLast(new ReadTimeoutHandler(readTimeOut, TimeUnit.MILLISECONDS));
channel.pipeline().addLast(new WriteTimeoutHandler(writeTimeout, TimeUnit.MILLISECONDS));
return true;
});
});
WebClient.Builder webClientBuilder = WebClient.builder();
return webClientBuilder.clientConnector(connector);
}
use of org.springframework.http.client.reactive.ReactorClientHttpConnector in project spring-boot-admin by codecentric.
the class QueryIndexEndpointStrategyTest method httpConnector.
private ReactorClientHttpConnector httpConnector() {
SslContextBuilder sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE);
HttpClient client = HttpClient.create().secure((ssl) -> ssl.sslContext(sslCtx));
return new ReactorClientHttpConnector(client);
}
Aggregations