Interface ClientBuilder

    • Method Detail

      • multipart

        ClientBuilder multipart()
        Enables the multipart feature on the client.
        Returns:
        this builder
      • connectTimeout

        ClientBuilder connectTimeout​(int millis)
        Sets the connect timeout for the client.
        Parameters:
        millis - length of timeout in millis
        Returns:
        this builder
      • connectTimeout

        ClientBuilder connectTimeout​(long millis)
        Sets the connect timeout for the client.
        Parameters:
        millis - length of timeout in millis
        Returns:
        this builder
      • readTimeout

        ClientBuilder readTimeout​(int millis)
        Sets the read timeout for the client.
        Parameters:
        millis - length of timeout in millis
        Returns:
        this builder
      • readTimeout

        ClientBuilder readTimeout​(long millis)
        Sets the read timeout for the client.
        Parameters:
        millis - length of timeout in millis
        Returns:
        this builder
      • timeoutsFrom

        ClientBuilder timeoutsFrom​(ServiceIdentifier serviceIdentifier)
        Sets the connect and read timeouts for the client from a ServiceIdentifier. This is most useful when you already have a ServiceIdentifier for a specific service, and you want to create a new RegistryAwareClient for use making requests to that service. This in no way precludes using the client to connect to any other service, but is a convenience when you are using the "bulkhead" pattern.

        See Michael Nygard's excellent book Release It! for information on stability patterns including bulkheads. Microsoft also has a good description in their Azure design patterns.

        Parameters:
        serviceIdentifier - defines the read and connect timeouts to set on the client
        Returns:
        this builder
      • sslContext

        ClientBuilder sslContext​(SSLContext sslContext)
        Sets the SSL context for the client.
        Parameters:
        sslContext - The SSLContext to use
        Returns:
        this builder
      • tlsConfigProvider

        ClientBuilder tlsConfigProvider​(org.kiwiproject.config.provider.TlsConfigProvider tlsConfigProvider)
        Provides a TlsConfigProvider to use to provide TLS configuration.
        Parameters:
        tlsConfigProvider - The config provider to provide TLS settings
        Returns:
        this builder
      • registryClient

        ClientBuilder registryClient​(org.kiwiproject.registry.client.RegistryClient registryClient)
        Provides the RegistryClient to use to find services.
        Parameters:
        registryClient - The RegistryClient responsible for looking up services to connect to
        Returns:
        this builder