【发布时间】:2017-07-30 03:27:09
【问题描述】:
我在我的应用程序中使用 Spring 数据 Couchbase。我正在使用 CouchbaseOperations 对象通过以下代码查找集群信息。
List<Version> versions = this.couchbaseOperations.getCouchbaseClusterInfo().getAllVersions();
这为我提供了我正在使用的 couchbase 服务器的版本。这工作正常。
但问题是它总是给我 Couchbase Server 的版本,不管服务器是启动还是关闭。
所以我的用例是,如果我的 couchbase 服务器已关闭,我需要显示 Couchbase 服务器已关闭。
因此,任何人都可以给我一种方法来使用 CouchbaseOperation 对象或 CouchbaseTemplate 对象或任何其他方法中的任何内置方法检查 Couchbase 服务器的状态。
提前致谢。
【问题讨论】:
标签: spring couchbase spring-boot-actuator spring-data-couchbase