Spring 使用 Couchbase 进行缓存 - 视图在此存储桶类型上不可用

Spring Caching with Couchbase - Views are not available on this bucket type

我尝试在我的应用程序中使用 couchbase-spring-cache。按照配置进行操作,但在我的应用程序开始时抛出此错误...

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.CacheManager]: Factory method 'cacheManager' threw exception; nested exception is com.couchbase.client.core.ServiceNotAvailableException: Views are not available on this bucket type. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 47 more Caused by: com.couchbase.client.core.ServiceNotAvailableException: Views are not available on this bucket type. at com.couchbase.client.core.node.locate.ViewLocator.(ViewLocator.java:34) at com.couchbase.client.core.RequestHandler.(RequestHandler.java:89) at com.couchbase.client.core.RequestHandler.(RequestHandler.java:136) at com.couchbase.client.core.CouchbaseCore.(CouchbaseCore.java:178) at com.couchbase.client.java.CouchbaseAsyncCluster.(CouchbaseAsyncCluster.java:262)

我需要配置什么吗?提前致谢。

您使用的是 "memcached" 类型的桶吗?

目前仅支持 Couchbase 类型的存储桶。 Spring Cache couchbase 实现和 Spring Data Couchbase 都依赖 viewsN1QL 来实现 API 的某些功能,这些在 memcached 型桶。

在缓存中,视图是将多个缓存并置在同一个存储桶中并且仍然能够执行 clear.

所必需的

我将更新自述文件以阐明这一点。另一种方法是在 memcache 存储桶上使用 flush,但使用错误会造成很大的破坏(您必须 100% 确定 只有 单个缓存的数据存储在 memcache bucket 中。因为清除缓存会删除 backing bucket 中包含的 ALL 个文档。所以目前它还没有真正在路线图上。