Move Cassandra health auto-configuration into spring-boot-cassandra
This commit is contained in:
committed by
Phillip Webb
parent
c4de496ae4
commit
f0e9ee14f9
@@ -41,12 +41,6 @@
|
||||
"level": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "management.health.cassandra.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable Cassandra health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.health.couchbase.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
@@ -4,8 +4,6 @@ org.springframework.boot.actuate.autoconfigure.availability.AvailabilityHealthCo
|
||||
org.springframework.boot.actuate.autoconfigure.availability.AvailabilityProbesAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.cache.CachesEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthContributorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthContributorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.apache.cassandra:java-driver-core")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional("io.projectreactor:reactor-core")
|
||||
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlSession;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthContributorConfigurations.CassandraDriverConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.cassandra.actuate.health.CassandraDriverHealthIndicator;
|
||||
import org.springframework.boot.cassandra.actuate.health.autoconfigure.CassandraHealthContributorConfigurations.CassandraDriverConfiguration;
|
||||
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
@@ -34,10 +35,10 @@ import org.springframework.context.annotation.Import;
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@AutoConfiguration(afterName = {
|
||||
"org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthContributorAutoConfiguration",
|
||||
"org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration" })
|
||||
@ConditionalOnClass({ CqlSession.class, CassandraDriverHealthIndicator.class })
|
||||
@AutoConfiguration(
|
||||
after = { CassandraReactiveHealthContributorAutoConfiguration.class, CassandraAutoConfiguration.class })
|
||||
@ConditionalOnClass({ CqlSession.class, CassandraDriverHealthIndicator.class,
|
||||
ConditionalOnEnabledHealthIndicator.class })
|
||||
@ConditionalOnEnabledHealthIndicator("cassandra")
|
||||
@Import(CassandraDriverConfiguration.class)
|
||||
public class CassandraHealthContributorAutoConfiguration {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -14,17 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlSession;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthContributorConfigurations.CassandraReactiveDriverConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.cassandra.actuate.health.CassandraDriverReactiveHealthIndicator;
|
||||
import org.springframework.boot.cassandra.actuate.health.autoconfigure.CassandraHealthContributorConfigurations.CassandraReactiveDriverConfiguration;
|
||||
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
@@ -35,8 +36,9 @@ import org.springframework.context.annotation.Import;
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@AutoConfiguration(afterName = "org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration")
|
||||
@ConditionalOnClass({ CqlSession.class, Flux.class, CassandraDriverReactiveHealthIndicator.class })
|
||||
@AutoConfiguration(after = CassandraAutoConfiguration.class)
|
||||
@ConditionalOnClass({ CqlSession.class, Flux.class, CassandraDriverReactiveHealthIndicator.class,
|
||||
ConditionalOnEnabledHealthIndicator.class })
|
||||
@ConditionalOnEnabledHealthIndicator("cassandra")
|
||||
@Import(CassandraReactiveDriverConfiguration.class)
|
||||
public class CassandraReactiveHealthContributorAutoConfiguration {
|
||||
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Auto-configuration for actuator Cassandra concerns.
|
||||
*/
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
@@ -1,6 +1,12 @@
|
||||
{
|
||||
"groups": [],
|
||||
"properties": [
|
||||
{
|
||||
"name": "management.health.cassandra.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable Cassandra health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.cassandra.compression",
|
||||
"defaultValue": "none"
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
org.springframework.boot.cassandra.actuate.health.autoconfigure.CassandraHealthContributorAutoConfiguration
|
||||
org.springframework.boot.cassandra.actuate.health.autoconfigure.CassandraReactiveHealthContributorAutoConfiguration
|
||||
org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlSession;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.cassandra;
|
||||
package org.springframework.boot.cassandra.actuate.health.autoconfigure;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlSession;
|
||||
import org.junit.jupiter.api.Test;
|
||||
Reference in New Issue
Block a user