AmirM86
AmirM86

Reputation: 113

webClient issue - Between ReactorClientHttpConnector and httpClient

I am facing a problem with versions , first let me explain the problem. I have the below code :

public WebClient createWebClient() throws SSLException {
        SslContext sslContext = SslContextBuilder
                .forClient()
                .trustManager(InsecureTrustManagerFactory.INSTANCE)
                .build();
        HttpClient httpClient = HttpClient.create().secure(t -> t.sslContext(sslContext));

        return WebClient.builder().baseUrl(endpointURL)
                .clientConnector(new ReactorClientHttpConnector(httpClient))
                .filter(errorHandlingFilter())
                .build();
    }

with spring-web version 5.2.3 and netty version 0.9.3 the part with the clientConnector is working fine. Now the version I have is 5.0.11 (ONLY) and then this part of the code stops to work with the error :

incompatible types: reactor.netty.http.client.HttpClient cannot be converted to java.util.functi
on.Consumer<? super reactor.ipc.netty.http.client.HttpClientOptions.Builder>

Is there any alternative with the older version of spring-web?

Thanks in advance =)

Upvotes: 2

Views: 2023

Answers (1)

Brian Clozel
Brian Clozel

Reputation: 59086

I don't think this is possible. The HttpClientOptions has been removed from reactor-netty in its 0.8.x generation, and you're effectively trying to use a 2 years old Spring Framework generation with a 9 months old release.

The Spring team is trying hard to maintain compatibility, but in the case of reactor netty, this is still a project in its 0.x phase and API changes/repackaging are still expected.

Upvotes: 3

Related Questions