Interface FeedClientBuilder


  • public interface FeedClientBuilder
    Builder for creating a FeedClient instance.
    Author:
    bjorncs, jonmv
    • Method Detail

      • create

        static FeedClientBuilder create​(URI endpoint)
        Creates a builder for a single container endpoint
      • setConnectionsPerEndpoint

        FeedClientBuilder setConnectionsPerEndpoint​(int max)
        Sets the number of connections this client will use per endpoint. A reasonable value here is a value that lets all feed clients (if more than one) collectively have a number of connections which is a small multiple of the numbers of containers in the cluster to feed, so load can be balanced across these containers. In general, this value should be kept as low as possible, but poor connectivity between feeder and cluster may also warrant a higher number of connections.
      • setMaxStreamPerConnection

        FeedClientBuilder setMaxStreamPerConnection​(int max)
        Sets the maximum number of streams per HTTP/2 connection for this client. This determines the maximum number of concurrent, inflight requests for this client, which is maxConnections * maxStreamsPerConnection. Prefer more streams over more connections, when possible. The feed client automatically throttles load to achieve the best throughput, and the actual number of streams per connection is usually lower than the maximum.
      • addRequestHeader

        FeedClientBuilder addRequestHeader​(String name,
                                           Supplier<String> valueSupplier)
        Adds HTTP request header to all client requests. Value Supplier is invoked for each HTTP request, i.e. value can be dynamically updated during a feed.
      • setCertificate

        FeedClientBuilder setCertificate​(Path certificatePemFile,
                                         Path privateKeyPemFile)
        Sets path to client SSL certificate/key PEM files
      • setCaCertificatesFile

        FeedClientBuilder setCaCertificatesFile​(Path caCertificatesFile)
        Overrides JVM default SSL truststore
        Parameters:
        caCertificatesFile - Path to PEM encoded file containing trusted certificates