Class ConfigServerRestClientHolder

java.lang.Object
org.springframework.cloud.config.client.ConfigServerRestClientHolder

public final class ConfigServerRestClientHolder extends Object
Holds the RestClient built from the RestTemplate that loaded the configuration from the config server, which carries the client's headers, credentials, TLS settings, timeouts and interceptors. It is registered as a bean of its own type, not as a RestClient, so that it is neither ambiguous with the application's own RestClient nor injected into it by accident.

Applications and libraries can inject this holder to call other config server endpoints with the same connection that loaded the configuration.

Since:
5.1.0
Author:
Sharang Gupta
  • Method Details

    • getRestClient

      public org.springframework.web.client.RestClient getRestClient()
      Return the RestClient that loaded the configuration from the config server.
      Returns:
      the config server client