Class ReactorNetty2ClientHttpConnector

java.lang.Object
org.springframework.http.client.reactive.ReactorNetty2ClientHttpConnector
All Implemented Interfaces:
ClientHttpConnector

public class ReactorNetty2ClientHttpConnector extends Object implements ClientHttpConnector
Reactor Netty 2 (Netty 5) implementation of ClientHttpConnector.

This class is based on ReactorClientHttpConnector.

Since:
6.0
Author:
Violeta Georgieva
See Also:
  • HttpClient
  • Constructor Details

    • ReactorNetty2ClientHttpConnector

      public ReactorNetty2ClientHttpConnector()
      Default constructor. Initializes HttpClient via:
       HttpClient.create().compress()
       
    • ReactorNetty2ClientHttpConnector

      public ReactorNetty2ClientHttpConnector(ReactorNetty2ResourceFactory factory, Function<reactor.netty5.http.client.HttpClient,reactor.netty5.http.client.HttpClient> mapper)
      Constructor with externally managed Reactor Netty resources, including LoopResources for event loop threads, and ConnectionProvider for the connection pool.

      This constructor should be used only when you don't want the client to participate in the Reactor Netty global resources. By default, the client participates in the Reactor Netty global resources held in HttpResources, which is recommended since fixed, shared resources are favored for event loop concurrency. However, consider declaring a ReactorNetty2ResourceFactory bean with globalResources=true in order to ensure the Reactor Netty global resources are shut down when the Spring ApplicationContext is closed.

      Parameters:
      factory - the resource factory to obtain the resources from
      mapper - a mapper for further initialization of the created client
      Since:
      5.1
    • ReactorNetty2ClientHttpConnector

      public ReactorNetty2ClientHttpConnector(reactor.netty5.http.client.HttpClient httpClient)
      Constructor with a pre-configured HttpClient instance.
      Parameters:
      httpClient - the client to use
      Since:
      5.1
  • Method Details