Neo4j 1.9.2,SDN 2.3.0.M1,SpringFramework 3.2.3.RELEASE。
我对我的应用程序进行了压力测试,该应用程序由两个使用异步处理来交换消息的微服务组成。源服务是 Neo4J。
一般流存储~>message->process~>message~>retrieve
在存储期间,我将 startnode、endnode 和基于属性的关系保留在单个事务中。都好。消息传递是异步的。
我正在使用在非线程 JUnit 测试中触发的约 1000 个请求来测试上述流程。
在检索步骤期间,可能会出现一次或两次,有时永远不会,我得到以下堆栈跟踪:
Caused by: org.neo4j.graphdb.NotFoundException: '__type__' property not found for RelationshipImpl #3027 of type 9 between Node[1009] and Node[1516].
at org.neo4j.kernel.impl.core.Primitive.newPropertyNotFoundException(Primitive.java:193)
at org.neo4j.kernel.impl.core.Primitive.getProperty(Primitive.java:188)
at org.neo4j.kernel.impl.core.RelationshipImpl.getProperty(RelationshipImpl.java:29)
at org.neo4j.kernel.impl.core.RelationshipProxy.getProperty(RelationshipProxy.java:114)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.readAliasFrom(AbstractIndexingTypeRepresentationStrategy.java:107)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.readAliasFrom(TRSTypeAliasAccessor.java:36)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.readAliasFrom(TRSTypeAliasAccessor.java:26)
at org.springframework.data.convert.DefaultTypeMapper.readType(DefaultTypeMapper.java:101)
at org.springframework.data.convert.DefaultTypeMapper.getDefaultedTypeToBeUsed(DefaultTypeMapper.java:164)
at org.springframework.data.convert.DefaultTypeMapper.readType(DefaultTypeMapper.java:141)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityConverterImpl.read(Neo4jEntityConverterImpl.java:76)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister$CachedConverter.read(Neo4jEntityPersister.java:170)
at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister.createEntityFromState(Neo4jEntityPersister.java:192)
at org.springframework.data.neo4j.support.Neo4jTemplate.findOne(Neo4jTemplate.java:155)
at com.auditbucket.engine.repo.neo4j.dao.AuditDaoNeo.getChange(AuditDaoNeo.java:239)
at com.auditbucket.engine.service.AuditService.handleSearchResult(AuditService.java:411)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
我很确定这与 SDN/Neo4J 库有关。关系不可能在创建时不存在,并且 Id 通过消息 Q 发送。很难看出事务是如何未提交的。无论如何都包含完整的代码块
....
AuditChange change = auditDAO.save(fUser, input, txRef);
AuditLog log = auditDAO.addLog(header, change, fortressWhen);
input.setStatus(AuditLogInputBean.LogStatus.OK);
if (searchActive) {
// Used to reconcile that the change was actually indexed
sd.setLogId(log.getId());
searchGateway.makeChangeSearchable(sd);
}
return input;