12.2.4 Configuring Neo4j
Micronaut features dedicated support for automatically configuring the Neo4j Bolt Driver for the popular Neo4j Graph Database.
Using the CLI If you are creating your project using the Micronaut CLI, supply the
|
To configure the Neo4j Bolt driver you should first add the neo4j-bolt
module to your classpath:
implementation("io.micronaut:micronaut-neo4j-bolt")
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-neo4j-bolt</artifactId>
</dependency>
You should then configure the URI of the Neo4j server you wish to communicate with in application.yml
:
Configuring neo4j.uri
neo4j:
uri: bolt://localhost
The neo4j.uri setting should be in the format as described in the Connection URIs section of the Neo4j documentation |
Once you have the above configuration in place you can inject an instance of the org.neo4j.driver.v1.Driver
bean, which features both a synchronous blocking API and a non-blocking API based on CompletableFuture
.
See the Micronaut Neo4j documentation for further information on configuring and using Neo4j within Micronaut.