Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Elasticsearch: update to new Java API #499

Closed
jloisel opened this issue Jun 27, 2022 · 6 comments
Closed

[Feature] Elasticsearch: update to new Java API #499

jloisel opened this issue Jun 27, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@jloisel
Copy link
Contributor

jloisel commented Jun 27, 2022

Elasticsearch Rest High Level Client is deprecated in favor of:
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/index.html

There is still the possibility to have both clients inside a single application:
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/migrate-hlrc.html

Still, would be better to migrate to the new client which is the standard for Elasticsearch 8.x.x as well.

@rdehuyss rdehuyss added the enhancement New feature or request label Jun 27, 2022
@rdehuyss
Copy link
Contributor

I'm aware of this but it's currently low prio as less than 1% of the installations uses Elastic.

@jloisel
Copy link
Contributor Author

jloisel commented Jun 28, 2022

Thanks for the feedback. As a workaround, we did:

  • Add older sdk to classpath:
    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>elasticsearch-rest-high-level-client</artifactId>
      <version>${elasticsearch.version}</version>
    </dependency>
  • Create a Spring configuration to load the RestHighLevelClient:
@Configuration
@ConditionalOnProperty(prefix = "org.jobrunr.job-scheduler", name = "enabled", havingValue = "true", matchIfMissing = true)
class JobRunrConfig {

  @Bean
  @SuppressWarnings("deprecated")
  RestHighLevelClient restHighLevelClient(final RestClient client) {
    return new RestHighLevelClientBuilder(client).build();
  }
}

@jloisel
Copy link
Contributor Author

jloisel commented Jun 28, 2022

We currently use Quartz along with a postgres database. We already have Elasticsearch to store the majority of our data. By switching from Quartz to JobRunr, we can get rid of quartz and the postgresql database.

@rdehuyss
Copy link
Contributor

I must confess that Elastic currently is not used by many installations in production - Most people use Postgres.

@jloisel
Copy link
Contributor Author

jloisel commented Jun 29, 2022

Completely understandable, Elasticsearch is rarely used as the main datastore.

rdehuyss added a commit that referenced this issue Oct 15, 2023
rdehuyss added a commit that referenced this issue Oct 16, 2023
@rdehuyss
Copy link
Contributor

Solved in branch 6.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants