Class ElasticsearchComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.component.elasticsearch.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.DefaultComponentRepresents the component that managesElasticsearchEndpoint.
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchComponent()ElasticsearchComponent(org.apache.camel.CamelContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.camel.EndpointcreateEndpoint(String uri, String remaining, Map<String,Object> parameters)org.elasticsearch.client.RestClientgetClient()intgetConnectionTimeout()The time in ms to wait before connection will timeout.StringgetHostAddresses()Comma separated list with ip:port formatted remote transport addresses to use.intgetMaxRetryTimeout()The time in ms before retryStringgetPassword()Password for authenticateintgetSniffAfterFailureDelay()The delay of a sniff execution scheduled after a failure (in milliseconds)intgetSnifferInterval()The interval between consecutive ordinary sniff executions in milliseconds.intgetSocketTimeout()The timeout in ms to wait before the socket will timeout.StringgetUser()Basic authenticate userbooleanisEnableSniffer()booleanisEnableSSL()voidsetClient(org.elasticsearch.client.RestClient client)To use an existing configured Elasticsearch client, instead of creating a client per endpoint.voidsetConnectionTimeout(int connectionTimeout)voidsetEnableSniffer(boolean enableSniffer)Enable automatically discover nodes from a running Elasticsearch cluster.voidsetEnableSSL(boolean enableSSL)Enable SSLvoidsetHostAddresses(String hostAddresses)voidsetMaxRetryTimeout(int maxRetryTimeout)voidsetPassword(String password)voidsetSniffAfterFailureDelay(int sniffAfterFailureDelay)voidsetSnifferInterval(int snifferInterval)voidsetSocketTimeout(int socketTimeout)voidsetUser(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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpointin classorg.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)
-
-