Package org.springframework.http.client
Class ReactorNettyClientRequestFactory
java.lang.Object
org.springframework.http.client.ReactorNettyClientRequestFactory
- All Implemented Interfaces:
- ClientHttpRequestFactory
Reactor-Netty implementation of 
ClientHttpRequestFactory.- Since:
- 6.1
- Author:
- Arjen Poutsma
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new instance of theReactorNettyClientRequestFactorywith a defaultHttpClientthat has compression enabled.ReactorNettyClientRequestFactory(reactor.netty.http.client.HttpClient httpClient) Create a new instance of theReactorNettyClientRequestFactorybased on the givenHttpClient.
- 
Method SummaryModifier and TypeMethodDescriptioncreateRequest(URI uri, HttpMethod httpMethod) Create a newClientHttpRequestfor the specified URI and HTTP method.voidsetConnectTimeout(int connectTimeout) Set the underlying connect timeout in milliseconds.voidsetConnectTimeout(Duration connectTimeout) Set the underlying connect timeout in milliseconds.voidsetExchangeTimeout(long exchangeTimeout) Set the timeout for the HTTP exchange in milliseconds.voidsetExchangeTimeout(Duration exchangeTimeout) Set the timeout for the HTTP exchange.voidsetReadTimeout(long readTimeout) Set the underlying read timeout in milliseconds.voidsetReadTimeout(Duration readTimeout) Set the underlying read timeout asDuration.
- 
Constructor Details- 
ReactorNettyClientRequestFactorypublic ReactorNettyClientRequestFactory()Create a new instance of theReactorNettyClientRequestFactorywith a defaultHttpClientthat has compression enabled.
- 
ReactorNettyClientRequestFactorypublic ReactorNettyClientRequestFactory(reactor.netty.http.client.HttpClient httpClient) Create a new instance of theReactorNettyClientRequestFactorybased on the givenHttpClient.- Parameters:
- httpClient- the client to base on
 
 
- 
- 
Method Details- 
setConnectTimeoutpublic void setConnectTimeout(int connectTimeout) Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout.Default is 30 seconds. - See Also:
- 
- Transport.option(ChannelOption, Object)
- ChannelOption.CONNECT_TIMEOUT_MILLIS
 
 
- 
setConnectTimeoutSet the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout.Default is 30 seconds. - See Also:
- 
- Transport.option(ChannelOption, Object)
- ChannelOption.CONNECT_TIMEOUT_MILLIS
 
 
- 
setReadTimeoutpublic void setReadTimeout(long readTimeout) Set the underlying read timeout in milliseconds.Default is 10 seconds. 
- 
setReadTimeoutSet the underlying read timeout asDuration.Default is 10 seconds. 
- 
setExchangeTimeoutpublic void setExchangeTimeout(long exchangeTimeout) Set the timeout for the HTTP exchange in milliseconds.Default is 30 seconds. 
- 
setExchangeTimeoutSet the timeout for the HTTP exchange.Default is 30 seconds. 
- 
createRequestDescription copied from interface:ClientHttpRequestFactoryCreate a newClientHttpRequestfor the specified URI and HTTP method.The returned request can be written to, and then executed by calling ClientHttpRequest.execute().- Specified by:
- createRequestin interface- ClientHttpRequestFactory
- Parameters:
- uri- the URI to create a request for
- httpMethod- the HTTP method to execute
- Returns:
- the created request
- Throws:
- IOException- in case of I/O errors
 
 
-