Skip to content

[FEATURE] support for Spring AOT #441

@rursprung

Description

@rursprung

Is your feature request related to a problem?

currently spring-data-elasticsearch supports AOT (see spring-projects/spring-data-elasticsearch#2423 & spring-projects/spring-data-elasticsearch#2579), however there is no official support for spring-data-opensearch and trying to build with it fails.
besides spring-data-opensearch not providing any AOT hints another problem is that ElasticsearchClientRuntimeHints requires elasticsearch-java as a dependency which isn't something we want to add since we're not using Elasticsearch and don't want unnecessary additional dependencies.

What solution would you like?

spring-data-opensearch should explicitly support Spring AOT. this requires several things:

  • it needs to provide the necessary runtime hints (and whatever else spring might want for AOT to work) for spring-data-opensearch, opensearch-java (that should probably be done here because they are spring-specific?) and maybe the ORHLC (unless you decide to skip if it's too much effort and everyone should anyway migrate to the new client?)
  • remove the dependency to elasticsearch-java which is being pulled in through spring-data-opensearch when AOT is being used
    • i could imagine that this requires using @ImportRuntimeHints rather than aot.factories for ElasticsearchClientRuntimeHints in spring-data-elasticsearch rather than aot.factories. the annotation can probably be put on the conditional configuration for the client.
  • add an example AOT application (more likely: the existing example application can be modified to support AOT and depending on a gradle option either the AOT or the normal version is being built & started.

What alternatives have you considered?

it doesn't make sense for consuming applications to try and implement this all on their own and try to work around problems (e.g. by pulling in elasticsearch-java).

Do you have any additional context?

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions