RestTemplateBuilder with readtimeout and httpclient5 fails with IllegalStateException #29404
Labels
for: external-project
Needs a fix in external project
status: duplicate
A duplicate of another issue
Affects: org.springframework.boot:spring-boot:3.0.0-RC1
What are we trying to do ?
instantiate a RestTemplateBuilder while having org.apache.httpcomponents.client5:httpclient5 on the runtime classpath.
(probable explanation in the end)
reproduce
https://gist.github.com/soft4rchitecture/729cf677a49d6d07a852aa22e1c9f830
expected result
the test succeeds
current result
the test fails with the following stack trace
preliminary explanations
org.springframework.boot.web.client.ClientHttpRequestFactorySupplier
is called to supply a CLientHttpRequestFactory.If
org.apache.hc.client5.http.impl.classic.HttpClients
is on the class path, thenorg.springframework.http.client.HttpComponentsClientHttpRequestFactory
is provided.HttpComponentsClientHttpRequestFactory
actually has thesetReadTimeout()
method deprecated since 6.0.When
org.springframework.boot.web.client.RestTemplateBuilder.RequestFactoryCustomizer#setReadTimeout
callsorg.springframework.http.client.HttpComponentsClientHttpRequestFactory#setReadTimeout
then expection is thrownThe text was updated successfully, but these errors were encountered: