Use the new Elasticsearch rest-client instead of the transport client (OPT-735)

[OPT-1635] Use rest client to initialize Elasticsearch schema on startup Created: 19/Nov/18  Updated: 18/Apr/19  Resolved: 03/Jan/19

Status: Done
Project: Camunda Optimize
Component/s: backend
Affects Version/s: None
Fix Version/s: 2.4.0, 2.4.0-alpha1

Type: Sub-task Priority: L3 - Default
Reporter: Sebastian Bathke Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified



  • the high level Elasticsearch rest client can be build from a static class in the Optimize commons package
  • the rest client is initialized in the same manner as the transport client
  • the transport client does not initialize the schema any longer
  • the schema is initialized by the rest client
  • the transport client is exposed directly instead of using a wrapper class
  • the Elasticsearch schema is initialized only once on initial startup, instead of calling it on each request
  • the Elasticsearch schema version is retrieved using the rest client


  • The transport client will be deprecated soon and also does not work on AWS. Therefore, we need to replace it by the high level rest client.
  • In the past we supported the scenario that Optimize could be started first and then Elasticsearch and Optimize would then automatically initialize the schema. However, this scenario is not needed and makes everything very complicated. It is now required that Elasticsearch must be up running before Optimize is started. This way we only need to initialize the Schema once on the start.

Generated at Mon Aug 26 11:42:57 CEST 2019 using JIRA 6.4.6#64021-sha1:33e5b454af4594f54560ac233c30a6e00459507e.