Closed pentarex closed 4 years ago
You are declaring only the spring-data-neo4j-rx
dependency. This will not create the needed infrastructure for your code to work. Since you are developing a Spring Boot application, you should declare the Spring Boot starter instead of the direct relationship:
<dependency>
<groupId>org.neo4j.springframework.data</groupId>
<artifactId>spring-data-neo4j-rx-spring-boot-starter</artifactId>
<version>1.0.0-rc01</version>
</dependency>
This will also have the benefit that it pulls ins the Neo4j Driver Spring Boot starter as a transitive dependency and you can define all the needed connection properties in the application.properties file like:
org.neo4j.driver.uri=bolt://localhost:7687
org.neo4j.driver.authentication.username=neo4j
org.neo4j.driver.authentication.password=secret
If you do not want to work with the starter (hint: you really should) you can use the @EnableNeo4jRepositories
annotation but also have to define a bean of type org.neo4j.driver.Driver
.
@Bean
public Driver driver() {
return GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "secret"));
}
Side note: If you are working with database-side generated ids, they should be of type Long
.
Is this working for you? I would like to close this issue if it is no longer active.
Closed due to inactivity. Please feel free to re-open this if this does solve your problem.
Sorry, I was not available. It does work. Thank you!
Hi,
I am playing around with spring boot webflux and neo4j and I am having the following issue.
My User looks like that
My Repository looks like that
My Service Implementation looks like that
The whole code you can find under https://github.com/pentarex/spring-rx-neo4j I have tried with rc01 and currently trying with beta04
If I try the same code (except Node I replace with Document and ReactiveNeo4jRepository with ReactiveCrudRepositry) with mongodb it works. Am I missing something?
I have also tried setting @EnableNeo4jRepositories("com.example.rx.repository") to my Main class, but no success
BR, Hristo