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 create your project using the Micronaut CLI, supply the
|
To configure the Neo4j Bolt driver, first add the neo4j-bolt
module to your build:
implementation("io.micronaut:micronaut-neo4j-bolt")
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-neo4j-bolt</artifactId>
</dependency>
Then configure the URI of the Neo4j server in application.yml
:
Configuring neo4j.uri
neo4j:
uri: bolt://localhost
The neo4j.uri setting must 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.