As mentioned here,
http://neo4j.com/docs/stable/transactions-events.html
Transaction Event listeners execute in an unpredictable sequence.
I'd like to assign a UUID on an entity before pushing it to Elastic Search, and have that field indexed, instead of the default @GraphId of neo4j, which was specifically described as bad practice, which I understand why the neo4j UUID plugin was made.
These are the 2 documented plugins for neo4j that I'm trying to use to achieve that.
https://github.com/neo4j-contrib/neo4j-elasticsearch https://github.com/graphaware/neo4j-uuid
A sample neo4j.properties configuration would be:
#elasticsearch plugin
elasticsearch.host_name=http://localhost:9200
elasticsearch.index_spec=persons:Person(uuid,name)
#uuid plugin
com.graphaware.module.UIDM.uuidProperty=uuid
By trying to create a Person node, I get an exception with the following trace
Caused by: org.neo4j.kernel.api.exceptions.TransactionHookException: Transaction handler failed.
at org.neo4j.kernel.impl.api.TransactionHooks$TransactionHooksState.add(TransactionHooks.java:100)
at org.neo4j.kernel.impl.api.TransactionHooks.beforeCommit(TransactionHooks.java:59)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:512)
... 37 more
Caused by: org.neo4j.graphdb.NotFoundException: NODE[2] has no property with propertyKey="uuid".
at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:482)
at org.neo4j.elasticsearch.ElasticSearchEventHandler.nodeToJson(ElasticSearchEventHandler.java:188)
at org.neo4j.elasticsearch.ElasticSearchEventHandler.indexRequests(ElasticSearchEventHandler.java:119)
at org.neo4j.elasticsearch.ElasticSearchEventHandler.beforeCommit(ElasticSearchEventHandler.java:47)
at org.neo4j.elasticsearch.ElasticSearchEventHandler.beforeCommit(ElasticSearchEventHandler.java:27)
at org.neo4j.kernel.TransactionEventHandlers.beforeCommit(TransactionEventHandlers.java:130)
at org.neo4j.kernel.TransactionEventHandlers.beforeCommit(TransactionEventHandlers.java:49)
... 39 more
Caused by: org.neo4j.kernel.api.exceptions.PropertyNotFoundException: NODE[2] has no property with propertyKeyId=31.
at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:475)
... 45 more
How can this be achieved if both plugins cannot work together?