Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-1787

Provide RestHighLevelClient only after schema got fully initialized

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • L3 - Default
    • 2.4.0-alpha1, 2.4.0
    • None
    • backend
    • None

    Description

      Currently the client is available even though the schema may not be initialized yet as this is done concurrently by ElasticSearchSchemaInitializer which also depends on the RestHighLevelClient.

      We need to encapsulate the schema initialization and the provision of the RestHighLevelClient bean and only then provide the RestHighLevelClient to other consumers that can then use it unconditionally. E.g. via a SchemaInitializingEsClientFactory that creates the client, initializes the schema and then exposes the RestHighLevelClient bean.

      given:

      • the RestHighLevelClient is injected to a service/component

      when:

      • the component uses the RestHighLevelClient

      then:

      • there is a race condition between the component that uses the RestHighLevelClient trying to access the optimize schema and the ElasticSearchSchemaInitializer initializing that schema

      expected:

      • given the RestHighLevelClient is injected it should be ready to use and the schema guaranteed to be initialized

      Note:
      this makes the usage of

      @DependsOn({"elasticSearchSchemaInitializer"})
      

      in service components obsolete

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                sebastian.bathke Sebastian Bathke
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Salesforce