RestHighLevelClient in spring boot 2.1.x doesn't allow a spring cloud task to finish successfully

Steps to reproduce :

  1. Clone https://github.com/spring-cloud/spring-cloud-task/tree/master/spring-cloud-task-samples/timestamp
  2. Run the application - The service dies after it prints the timestamp
  3. Add:
                <dependency>
			<groupId>org.elasticsearch.client</groupId>
			<artifactId>elasticsearch-rest-high-level-client</artifactId>
			<version>7.0.0</version>
		</dependency>
  1. Re-run the application - The service now stays alive

Notes
With:
Spring Cloud Task - Finchley.SR3
Spring Boot - 2.0.x
Rest High Level Client - 6.4.2
The app functions as intended.
With:
Spring Cloud Task - Greenwich.SR1
Spring Boot -2.1.x
Rest High Level Client - 6.4.2
The app exhibits the problematic behavior

Adding a configuration and beaning the RestHighLevelClient and closing the connection on task completion has no affect on this functionality.

How do you run the application? Is it with mvn run?

When using springboot with
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot declares a version 6.4...

Basically you can put this in your pom.xml:

<properties>
  <elasticsearch.version>7.0.0<elasticsearch.version>
</properties>

See documentation here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions

May be that could help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.