Class ElasticsearchComponent

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Component("elasticsearch-rest")
    public class ElasticsearchComponent
    extends org.apache.camel.support.DefaultComponent
    Represents the component that manages ElasticsearchEndpoint.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.camel.Endpoint createEndpoint​(String uri, String remaining, Map<String,​Object> parameters)  
      org.elasticsearch.client.RestClient getClient()  
      int getConnectionTimeout()
      The time in ms to wait before connection will timeout.
      String getHostAddresses()
      Comma separated list with ip:port formatted remote transport addresses to use.
      int getMaxRetryTimeout()
      The time in ms before retry
      String getPassword()
      Password for authenticate
      int getSniffAfterFailureDelay()
      The delay of a sniff execution scheduled after a failure (in milliseconds)
      int getSnifferInterval()
      The interval between consecutive ordinary sniff executions in milliseconds.
      int getSocketTimeout()
      The timeout in ms to wait before the socket will timeout.
      String getUser()
      Basic authenticate user
      boolean isEnableSniffer()  
      boolean isEnableSSL()  
      void setClient​(org.elasticsearch.client.RestClient client)
      To use an existing configured Elasticsearch client, instead of creating a client per endpoint.
      void setConnectionTimeout​(int connectionTimeout)  
      void setEnableSniffer​(boolean enableSniffer)
      Enable automatically discover nodes from a running Elasticsearch cluster.
      void setEnableSSL​(boolean enableSSL)
      Enable SSL
      void setHostAddresses​(String hostAddresses)  
      void setMaxRetryTimeout​(int maxRetryTimeout)  
      void setPassword​(String password)  
      void setSniffAfterFailureDelay​(int sniffAfterFailureDelay)  
      void setSnifferInterval​(int snifferInterval)  
      void setSocketTimeout​(int socketTimeout)  
      void setUser​(String user)  
      • Methods inherited from class org.apache.camel.support.DefaultComponent

        afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • ElasticsearchComponent

        public ElasticsearchComponent()
      • ElasticsearchComponent

        public ElasticsearchComponent​(org.apache.camel.CamelContext context)
    • Method Detail

      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createEndpoint in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • getClient

        public org.elasticsearch.client.RestClient getClient()
      • setClient

        public void setClient​(org.elasticsearch.client.RestClient client)
        To use an existing configured Elasticsearch client, instead of creating a client per endpoint. This allows to customize the client with specific settings.
      • getHostAddresses

        public String getHostAddresses()
        Comma separated list with ip:port formatted remote transport addresses to use. The ip and port options must be left blank for hostAddresses to be considered instead.
      • setHostAddresses

        public void setHostAddresses​(String hostAddresses)
      • getSocketTimeout

        public int getSocketTimeout()
        The timeout in ms to wait before the socket will timeout.
      • setSocketTimeout

        public void setSocketTimeout​(int socketTimeout)
      • getConnectionTimeout

        public int getConnectionTimeout()
        The time in ms to wait before connection will timeout.
      • setConnectionTimeout

        public void setConnectionTimeout​(int connectionTimeout)
      • getUser

        public String getUser()
        Basic authenticate user
      • setUser

        public void setUser​(String user)
      • getPassword

        public String getPassword()
        Password for authenticate
      • setPassword

        public void setPassword​(String password)
      • isEnableSSL

        public boolean isEnableSSL()
      • setEnableSSL

        public void setEnableSSL​(boolean enableSSL)
        Enable SSL
      • getMaxRetryTimeout

        public int getMaxRetryTimeout()
        The time in ms before retry
      • setMaxRetryTimeout

        public void setMaxRetryTimeout​(int maxRetryTimeout)
      • isEnableSniffer

        public boolean isEnableSniffer()
      • setEnableSniffer

        public void setEnableSniffer​(boolean enableSniffer)
        Enable automatically discover nodes from a running Elasticsearch cluster. If this option is used in conjunction with Spring Boot then it's managed by the Spring Boot configuration (see: Disable Sniffer in Spring Boot).
      • getSnifferInterval

        public int getSnifferInterval()
        The interval between consecutive ordinary sniff executions in milliseconds. Will be honoured when sniffOnFailure is disabled or when there are no failures between consecutive sniff executions
      • setSnifferInterval

        public void setSnifferInterval​(int snifferInterval)
      • getSniffAfterFailureDelay

        public int getSniffAfterFailureDelay()
        The delay of a sniff execution scheduled after a failure (in milliseconds)
      • setSniffAfterFailureDelay

        public void setSniffAfterFailureDelay​(int sniffAfterFailureDelay)