Skip to content

Questions about using Spring Data Jpa and Spring Data Elasticsearch console information #2940

@mitu2

Description

@mitu2

problem description

I didn't use @EnableReactiveElasticsearchRepositories, But it seems to scan my code and throw out some info messages.I wonder why it works, and it generates a message every time I add a JPA repository.

2024-07-13T19:43:33.338+08:00  INFO 4648 --- [spring-data-example] [  restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Reactive Elasticsearch - Could not safely identify store assignment for repository candidate interface org.example.springdataexample.repositories.jdbc.ItemRepository; If you want this repository to be a Reactive Elasticsearch repository, consider annotating your entities with one of these annotations: org.springframework.data.elasticsearch.annotations.Document (preferred), or consider extending one of the following types with your repository: org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository
2024-07-13T19:43:33.338+08:00  INFO 4648 --- [spring-data-example] [  restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data Reactive Elasticsearch - Could not safely identify store assignment for repository candidate interface org.example.springdataexample.repositories.jdbc.PersonRepository; If you want this repository to be a Reactive Elasticsearch repository, consider annotating your entities with one of these annotations: org.springframework.data.elasticsearch.annotations.Document (preferred), or consider extending one of the following types with your repository: org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository

I found that ReactiveElasticsearchRepositoriesAutoConfiguration triggers at the same time as ElasticsearchRepositoriesAutoConfiguration, and now I can only exclude one startup class to avoid it scanning my code with another

- @SpringBootApplication
+ @SpringBootApplication(exclude = ReactiveElasticsearchRepositoriesAutoConfiguration.class)
public class SpringDataExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringDataExampleApplication.class, args);
    }

}

Is there a better way to avoid this?

example code

I told you about my example code uploaded to

https://github.com/mitu2/spring-data-example

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions