Registering apoc in Neo4j 4.0

We use an embedded version of Neo4j and used to register procedures similar to:

Procedures procedures = ((GraphDatabaseAPI) graphDatabaseService).getDependencyResolver().resolveDependency(Procedures.class);
try {
	procedures.registerProcedures(Coll.class);
	procedures.registerProcedures(MyProcedure.class);
...

The problem is that after upgrading to Neo4j 4.0 and being forced to use bolt driver:

  1. resolveDependency results in

...UnsatisfiedDependencyException: No dependency satisfies type interface org.neo4j.internal.kernel.api.Procedures

  1. procedures does not have registerFunction and registerProcedure methods.

We use neo4j 4.0.0 and apoc 4.0.0.1.
How should we register APOCs now?

1 Like

Procedures has changed to GlobalProcedures. See https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/784f2ccaa6464f55c05e0520923413959e87e963/src/test/java/apoc/util/TestUtil.java#L117-L128 for snippet you can use.

1 Like