Search code examples
javamavenneo4jgraphaware

Deploying the GraphAware friendship-counter example to some standalone neo4j server


I'm giving the GraphAware's example a try to understand how it works. But I'm having trouble running their friendship counter example.

To this end, I've built the mentioned example package using mvn package which generated the following jar files:

  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT.jar
  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT-javadoc.jar
  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT-sources.jar
  • graphaware-friendship-strength-counter-module-3.1.0.45-SNAPSHOT.jar

Then I copied the first file alongside GraphAware framework-server-community's latest version into the plugins directory of the neo4j. Then I added the following line to neo4j.conf file:

dbms.unmanaged_extension_classes=com.graphaware.server=/graphaware

and restarted the neo4j server. When I go to http://localhost:7474/graphaware/friendship/strength I can see that the REST API part of the code is working since it returns 0 and also it creates a :FriendshipCounter node on the server.

But it seems that the FriendshipStrengthCounter class is not registered as a TransactionEventHandler since when I create the following two nodes:

CREATE (n)-[:FRIEND_OF{strength: 2}]->(m);

the counter is not updated. Can someone please tell me where did I make a mistake? Thanks.


Solution

  • Can you try enabling the framework and the module by adding those lines to your neo4j.conf :

    com.graphaware.runtime.enabled=true
    
    #COUNTER becomes the module ID:
    com.graphaware.module.COUNTER.1=com.graphaware.example.module.FriendshipStrengthModuleBootstrapper