Inqwise Neo4j Client is a lightweight wrapper around the Neo4j reactive Java driver, designed for seamless integration with Vert.x. It enables fully non-blocking database operations within Vert.x applications using a clean, reactive API.
The library adapts Neo4j’s official reactive driver to work efficiently within the Vert.x event loop.
To include this library in your project, add the following dependency:
<dependency>
<groupId>com.inqwise</groupId>
<artifactId>inqwise-neo4j-client</artifactId>
<version>${latest.version}</version>
</dependency>import com.inqwise.neo4j.Neo4jClient;
import com.inqwise.neo4j.Neo4jDriver;
import com.inqwise.neo4j.Neo4jSession;
import com.inqwise.neo4j.Neo4jResult;
// Initialize Neo4j driver
Neo4jDriver neo4j = Neo4jClient.create("bolt://localhost:7687", "neo4j", "password");
// Run a simple Cypher query
Neo4jSession session = neo4j.session();
session.run("MATCH (p:Person) RETURN p.name")
.onComplete(ar -> {
if (ar.succeeded()) {
Neo4jResult result = ar.result();
result.records().handler(record -> {
System.out.println("Found person: " + record.get("p.name").asString());
});
} else {
ar.cause().printStackTrace();
}
session.close(); // Close session when done
});This project is licensed under the MIT License. See the LICENSE file for details.