springtainer-elasticsearch
Dependency
<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-elasticsearch</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>
Configuration
Properties consumed (in bootstrap.properties
):
embedded.container.elasticsearch.enabled
(default istrue
)embedded.container.elasticsearch.startup-timeout
(default is30
)embedded.container.elasticsearch.docker-image
(default isdocker.elastic.co/elasticsearch/elasticsearch:7.6.2
)embedded.container.elasticsearch.http-port
(default is9200
)embedded.container.elasticsearch.transport-host
(default is9300
)
Properties provided (in application-it.properties
):
embedded.container.elasticsearch.host
embedded.container.elasticsearch.http-port
embedded.container.elasticsearch.transport-port
Example for minimal configuration in application-it.properties
:
spring.data.elasticsearch.cluster-nodes=${embedded.container.elasticsearch.host}:${embedded.container.elasticsearch.transport-port}
spring.data.elasticsearch.properties.client.transport.ignore_cluster_name=true
Logging
To reduce logging insert this into the logback-configuration:
<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />
Labels
The container exports multiple labels to analyze running springtainers:
SPRINGTAINER_SERVICE=elasticsearch
SPRINGTAINER_IMAGE=${embedded.container.elasticsearch.docker-image}
SPRINGTAINER_STARTED=$currentTimestamp