Class DefaultElasticsearchConfigurationProperties

java.lang.Object
io.micronaut.elasticsearch.DefaultElasticsearchConfigurationProperties
All Implemented Interfaces:
DefaultElasticsearchConfiguration

@Requires(classes=org.elasticsearch.client.RestClientBuilder.class) @ConfigurationProperties("elasticsearch") public class DefaultElasticsearchConfigurationProperties extends Object implements DefaultElasticsearchConfiguration
Default configurations for Elasticsearch.
Since:
1.0.0
Author:
lishuai, Puneet Behl
  • Field Details

    • httpAsyncClientBuilder

      protected org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder
    • requestConfigBuilder

      @ConfigurationBuilder(configurationPrefix="request.default") protected org.apache.http.client.config.RequestConfig.Builder requestConfigBuilder
      The default request configurations.
  • Constructor Details

    • DefaultElasticsearchConfigurationProperties

      public DefaultElasticsearchConfigurationProperties()
  • Method Details

    • getHttpHosts

      public org.apache.http.HttpHost[] getHttpHosts()
      Description copied from interface: DefaultElasticsearchConfiguration
      The one or more hosts that the client will communicate with, provided as instances of HttpHost.
      Specified by:
      getHttpHosts in interface DefaultElasticsearchConfiguration
      Returns:
      An array of HttpHost
    • getDefaultHeaders

      public org.apache.http.Header[] getDefaultHeaders()
      Description copied from interface: DefaultElasticsearchConfiguration
      The default headers that need to be sent with each request, to prevent having to specify them with each single request.
      Specified by:
      getDefaultHeaders in interface DefaultElasticsearchConfiguration
      Returns:
      An array of Header.
    • getMaxRetryTimeoutMillis

      public int getMaxRetryTimeoutMillis()
      Description copied from interface: DefaultElasticsearchConfiguration
      The timeout that should be honoured in case multiple attempts are made for the same request. The default value is 30 seconds.
      Specified by:
      getMaxRetryTimeoutMillis in interface DefaultElasticsearchConfiguration
      Returns:
      The maximum retry timeout in millis.
    • getNodeSelector

      public org.elasticsearch.client.NodeSelector getNodeSelector()
      Description copied from interface: DefaultElasticsearchConfiguration
      The node selector to be used to filter the nodes the client will send requests to among the ones that are set to the client itself. By default the client sends requests to every configured node.
      Specified by:
      getNodeSelector in interface DefaultElasticsearchConfiguration
      Returns:
      The NodeSelector to be used.
    • getRequestConfigBuilder

      public org.apache.http.client.config.RequestConfig.Builder getRequestConfigBuilder()
      Specified by:
      getRequestConfigBuilder in interface DefaultElasticsearchConfiguration
      Returns:
      The builder to create default request configurations.
    • getHttpAsyncClientBuilder

      public org.apache.http.impl.nio.client.HttpAsyncClientBuilder getHttpAsyncClientBuilder()
      Description copied from interface: DefaultElasticsearchConfiguration
      The http client configuration (e.g. encrypted communication over ssl, or anything that the HttpAsyncClientBuilder allows to set).
      Specified by:
      getHttpAsyncClientBuilder in interface DefaultElasticsearchConfiguration
      Returns:
      The HttpAsyncClientBuilder bean
    • setHttpHosts

      public void setHttpHosts(org.apache.http.HttpHost[] httpHosts)
      Parameters:
      httpHosts - One or more hosts that client will connect to.
    • setDefaultHeaders

      public void setDefaultHeaders(org.apache.http.Header[] defaultHeaders)
      Parameters:
      defaultHeaders - The defaults Header to sent with each request.
    • setMaxRetryTimeoutMillis

      public void setMaxRetryTimeoutMillis(int maxRetryTimeoutMillis)
      Parameters:
      maxRetryTimeoutMillis - The maximum retry timeout in millis.
    • setNodeSelector

      public void setNodeSelector(org.elasticsearch.client.NodeSelector nodeSelector)
      Parameters:
      nodeSelector - The NodeSelector to be used, in case of multiple nodes.
    • setHttpAsyncClientBuilder

      @Inject public void setHttpAsyncClientBuilder(org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpAsyncClientBuilder)
      Parameters:
      httpAsyncClientBuilder - The HttpAsyncClientBuilder bean