Camel Spring Boot

Elasticsearch Low level Rest Client

Index, get, delete and search documents, and create and delete indices, in Elasticsearch or OpenSearch with the Elasticsearch low-level REST client.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-elasticsearch-rest-client-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 15 options, which are listed below.

Name Description Default Type

camel.component.elasticsearch-rest-client.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.elasticsearch-rest-client.certificate-path

The CA certificate, in X.509 format, that the client trusts for HTTPS instead of the default trust store of the JVM. It is loaded from the classpath by default, or with the prefix classpath:, file: or http:. sslContextParameters takes precedence.

String

camel.component.elasticsearch-rest-client.connection-timeout

The connect timeout in milliseconds: the longest time that the client waits to establish the connection to a node. Zero means no timeout. Not used when the restClient option is set.

30000

Integer

camel.component.elasticsearch-rest-client.enable-sniffer

Whether to start the Sniffer of the Elasticsearch REST client, which reads the nodes of the cluster from its Nodes Info API at start and then at the snifferInterval, and updates the nodes that the client sends requests to. Not used when the restClient option is set.

false

Boolean

camel.component.elasticsearch-rest-client.enabled

Whether to enable auto configuration of the elasticsearch-rest-client component. This is enabled by default.

Boolean

camel.component.elasticsearch-rest-client.host-addresses-list

The comma-separated list of the nodes to connect to, each as [scheme://]host[:port], for example http://es1:9200,http://es2:9200. The scheme is http if not set, and the port is the default port of the scheme (80 for http, 443 for https) if not set. Required unless the restClient option is set.

String

camel.component.elasticsearch-rest-client.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.elasticsearch-rest-client.password

The password for basic authentication. Used only when user is also set.

String

camel.component.elasticsearch-rest-client.rest-client

The org.elasticsearch.client.RestClient to use, instead of a client that the producer creates. When set, hostAddressesList and the timeout, security and sniffer options are not used, and the producer does not close the client when it stops. The option is a org.elasticsearch.client.RestClient type.

RestClient

camel.component.elasticsearch-rest-client.sniff-after-failure-delay

The delay in milliseconds of the read of the nodes that the Sniffer schedules after a failed request, when enableSniffer is set. Must be greater than 0. It has no effect at the moment, as the client is created without the listener that reports failed requests to the Sniffer. The Sniffer then reads the nodes only at the snifferInterval.

60000

Integer

camel.component.elasticsearch-rest-client.sniffer-interval

The interval in milliseconds between two reads of the nodes of the cluster, when enableSniffer is set. Must be greater than 0.

60000

Integer

camel.component.elasticsearch-rest-client.socket-timeout

The socket timeout in milliseconds: the longest time that the client waits for data from a node before the request fails. Zero means no timeout. Not used when the restClient option is set.

30000

Integer

camel.component.elasticsearch-rest-client.ssl-context-parameters

To configure security using SSLContextParameters, which sets the protocols, cipher suites, named groups and signature schemes of the HTTPS connection. It takes precedence over certificatePath. The option is a org.apache.camel.support.jsse.SSLContextParameters type.

SSLContextParameters

camel.component.elasticsearch-rest-client.use-global-ssl-context-parameters

Enable usage of global SSL context parameters.

false

Boolean

camel.component.elasticsearch-rest-client.user

The user name for basic authentication. Used only when password is also set.

String