问题描述
我有一个服务可以自动连接两个存储库,一个反应式 neo4j 存储库和一个反应式 mongo 存储库
@Service
class TestService(
val neo4jRepository: MyNeo4jRepository,val mongoRepository: MyMongoRepository
) {
suspend fun get(id: String) {
val record = getFromNeo4j(id)
val secondRecord = getFromMongo(id)
}
suspend fun getFromNeo4j(id: String,fetchRelated: Boolean = true): MyNeo4jEntity? {
return neo4jRepository.findFirstById(id).awaitFirstOrNull()
}
suspend fun getFromMongo(id: String): List<AreaMeasurement> {
return mongoRepository.findWithSpecificQuery(id).asFlow().toList()
}
}
当我尝试存储它时,我在 mongoRepository 上崩溃了
Unsupported extension type: org.springframework.data.neo4j.repository.support.Neo4jEvaluationContextExtension@1b19905c
这有点奇怪
- 为什么涉及到 neo4j?
- 为什么我得到的是 Neo4JEvaluationContextExtension 而不是反应式扩展?
org.springframework.data.spel;
public class ReactiveExtensionAwareEvaluationContextProvider { /*...*/
if (it instanceof ReactiveevaluationContextExtension) {
/* code */
return Mono.empty();
}
return Mono.error(new IllegalStateException("Unsupported extension type: " + it));
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)