Class ApacheConfigurator

  • All Implemented Interfaces:
    ClientConfigurator, HasApacheConnectorProperties, SetsClientBuilderProperties
    Direct Known Subclasses:
    ApacheConfigurator.NonBuffering, ConnectionPoolingApacheConfigurator

    public class ApacheConfigurator
    extends Object
    implements ClientConfigurator, SetsClientBuilderProperties, HasApacheConnectorProperties
    A ClientConfigurator implementation that uses the Apache HTTP Connector Provider for the Jersey Client configuration.

    This enables support for connection pooling in addition to per-client HTTP(S) proxy support.

    Note: Use of the ApacheConnectorProvider will buffer requests into memory and can impact memory utilization within your application. To avoid buffering of requests in memory, please use ApacheConfigurator.NonBuffering Apache Configurator by default configures a connection pool with default values for defaultMaxConnectionsPerRoute and maximum open connections. Please make sure to close all InputStreams obtained from the response object by calling close on the stream object. For example - GetObjectResponse.getInputStream().close or try-with-resources. Otherwise, the connection is not released from the pool and results in hanging for an indefinite time.

    • Field Detail

      • clientConfigDecorators

        protected final List<ClientConfigDecorator> clientConfigDecorators
        The list of ClientConfigDecorators to support the ability to decorate ClientConfig
      • apacheConnectorProperties

        protected ApacheConnectorProperties apacheConnectorProperties
        Getter for ApacheConnectorProperties for the Apache Connection *
    • Constructor Detail

      • ApacheConfigurator

        public ApacheConfigurator()
        Creates a new ApacheConfigurator object.
      • ApacheConfigurator

        public ApacheConfigurator​(List<ClientConfigDecorator> clientConfigDecorators)
        Creates a new ApacheConfigurator and registers the list of provided ClientConfigDecorators.
        Parameters:
        clientConfigDecorators - the list of client configuration decorators
      • ApacheConfigurator

        public ApacheConfigurator​(@Nonnull
                                  ApacheConnectorProperties apacheConnectorProperties)
        Creates a new ApacheConfigurator object and sets the ApacheConnectorProperties
      • ApacheConfigurator

        public ApacheConfigurator​(@Nonnull
                                  ApacheConnectorProperties apacheConnectorProperties,
                                  List<ClientConfigDecorator> clientConfigDecorators)
        Creates a new ApacheConfigurator object and sets the ApacheConnectorProperties and registers the list of provided ClientConfigDecorators