Runtime configuration

At runtime, the REST library first parses the external configuration parameters and then calls the suppliers to build their instances. The following table lists the runtime configuration parameters:
Parameter Description
basePath The base path to the REST endpoint URL
auth The authentication method that the REST API client uses. The following methods are supported:
  • HttpBasic
  • HttpBearer
  • ApiKey
  • OAuth
eventHandlers An array of eventHandlers that are applied to each request. The type property determines the event handler type:
  • retry
  • circuitbreaker
  • fallback
loggerName Defines a logger for an endpoint. Use this setting to define different logger for each endpoint.
logLevel Defines what information to log:
  • NONE

    No logging

  • BASIC

    Logs method, URL, response status, and execution time.

  • HEADERS

    Logs the BASIC information and request/response headers.

  • FULL

    Logs the HEADERS information, body, and metadata for request/response.

By default the logLevel is set to NONE.
timeout The timeout configuration for the request
  • connectTimeoutMillis

    Required

Defines the connection timeout in milliseconds. The default is set to 5 ms.
  • readTimeoutMillis

    Required

Defines the timeout for the waiting time on a read request. The timeout is in milliseconds. The default is 5 ms.
httpClient The configuration object for an HTTP client or Mutual Transport Layer Security (TLS) authentication
  • client
An Apache HttpClient.
  • hostnameVerifier
A functional class that accepts a Map<String,String> and returns an object that implements HostnameVerifier. This is ignored if ClientSupplierClass is provided.
  • context
A functional class that accepts a Map<String,String> and returns an object that implements SSLSocketFactory.
interceptors An array of additional interceptors. Interceptors provide a mechanism to intercept and/or mutate outgoing requests or incoming responses. The following interceptors are already added to the REST API client:
  • ForwardingInterceptor
  • HttpBearerAuth
  • ApiKeyAuth
traceActionsClass A class that implements TraceabilityActions. This is required only if you use a diagnostic context that is different than Mapped Diagnostic Context (MDC) for holding this information.
mapper An object mapper
credentialSupplier A functional class that accepts a key and a default value with the credentials that are used to authenticate the HTTP requests. The class returns an object the implements the CredentialSupplier class.