How to configure neo4j and cassandra repositories in same spring boot application

风格不统一 提交于 2019-12-02 02:46:17

This looks like the Spring Boot autoconfiguration is not able to handle multiple Spring Data projects at the same time.

Please refer to documentation for Spring Data Neo4j and Spring Data Cassandra

In particular you should point SDN module to neo4j repositories only

@EnableNeo4jRepositories(basePackages = "org.test.project.repositories.neo")

and similarly for cassandra.

I have used neo4j with mongo. I don't see any issues. I presume it should be same with cassandra. This is all the configuration I have

@SpringBootApplication
@EnableConfigurationProperties
@EnableNeo4jRepositories("com.in.neo4j.repository.neo")
@EnableMongoRepositories("com.in.neo4j.repository.mongo")
public class Neo4JApplication {
    public static void main(String[] args) {
        SpringApplication.run(Neo4JApplication.class, args);
    }
}

And in my properties file I have

spring.data.neo4j.username=neo4j  
spring.data.neo4j.password=admin  

spring.data.mongodb.database=blah  
spring.data.mongodb.host=blahblah  
spring.data.mongodb.port=27017
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!