Details
-
Task
-
Status: Done
-
L3 - Default
-
Resolution: Done
-
None
-
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
- mentioned in
-
Page Loading...