Bolt connector
This describes how to open a Bolt connector to your embedded instance to get GUI administration and other benefits. Accessing Neo4j embedded via the Bolt protocol.
The Neo4j Browser and the official Neo4j Drivers use the Bolt database protocol to communicate with Neo4j. By default, Neo4j embedded does not expose a Bolt connector, but you can enable one. Doing so allows you to connect the services of Neo4j Browser to your embedded instance.
It also gives you a way to incrementally transfer an existing Embedded application to use Neo4j Drivers instead. Migrating to Neo4j Drivers means you can run Neo4j embedded or Neo4j server, without having to change your application code.
To add a Bolt Connector to your embedded database, you must add the Bolt extension to your classpath. This is done by adding a dependency to your project:
<project>
...
<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-bolt</artifactId>
<version>5.25.0</version>
</dependency>
...
</dependencies>
...
</project>
With this dependency in place, you can configure Neo4j to enable the Bolt connector:
The source code for the example can befound at: EmbeddedNeo4jWithBolt.java |
DatabaseManagementService managementService = new DatabaseManagementServiceBuilder( DB_PATH )
.setConfig( BoltConnector.enabled, true )
.setConfig( BoltConnector.listen_address, new SocketAddress( "localhost", 7687 ) )
.build();