Move code from spring-boot-actuator to spring-boot-data-elasticsearch
This commit is contained in:
committed by
Phillip Webb
parent
0c55d5beb8
commit
3866abb2ca
@@ -21,13 +21,13 @@ import reactor.core.publisher.Flux;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.data.elasticsearch.actuate.health.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient;
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchCl
|
||||
*/
|
||||
@AutoConfiguration(
|
||||
afterName = "org.springframework.boot.elasticsearch.autoconfigure.ReactiveElasticsearchClientAutoConfiguration")
|
||||
@ConditionalOnClass({ ReactiveElasticsearchClient.class, Flux.class })
|
||||
@ConditionalOnClass({ ReactiveElasticsearchClient.class, Flux.class, ElasticsearchReactiveHealthIndicator.class })
|
||||
@ConditionalOnBean(ReactiveElasticsearchClient.class)
|
||||
@ConditionalOnEnabledHealthIndicator("elasticsearch")
|
||||
public class ElasticsearchReactiveHealthContributorAutoConfiguration extends
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,9 +20,9 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticsearchRestHealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.data.elasticsearch.actuate.health.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.boot.data.elasticsearch.autoconfigure.ElasticsearchDataAutoConfiguration;
|
||||
import org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchRestClientAutoConfiguration;
|
||||
import org.springframework.boot.elasticsearch.autoconfigure.ReactiveElasticsearchClientAutoConfiguration;
|
||||
|
||||
@@ -43,6 +43,7 @@ dependencies {
|
||||
optional("com.fasterxml.jackson.core:jackson-databind")
|
||||
optional("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
|
||||
optional("com.github.ben-manes.caffeine:caffeine")
|
||||
optional("com.google.code.findbugs:jsr305")
|
||||
optional("com.hazelcast:hazelcast-spring")
|
||||
optional("com.zaxxer:HikariCP")
|
||||
optional("io.lettuce:lettuce-core")
|
||||
@@ -81,7 +82,6 @@ dependencies {
|
||||
optional("org.springframework:spring-web")
|
||||
optional("org.springframework:spring-webmvc")
|
||||
optional("org.springframework.graphql:spring-graphql")
|
||||
optional("org.springframework.data:spring-data-elasticsearch")
|
||||
optional("org.springframework.data:spring-data-ldap")
|
||||
optional("org.springframework.data:spring-data-mongodb")
|
||||
optional("org.springframework.data:spring-data-redis")
|
||||
|
||||
@@ -13,6 +13,7 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-elasticsearch"))
|
||||
api("org.springframework.data:spring-data-elasticsearch")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-reactor"))
|
||||
|
||||
@@ -27,6 +28,8 @@ dependencies {
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
||||
testImplementation("com.squareup.okhttp3:mockwebserver")
|
||||
testImplementation("org.springframework:spring-web")
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.data.elasticsearch;
|
||||
package org.springframework.boot.data.elasticsearch.actuate.health;
|
||||
|
||||
import co.elastic.clients.elasticsearch._types.HealthStatus;
|
||||
import co.elastic.clients.elasticsearch.cluster.HealthResponse;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchCl
|
||||
* @author Brian Clozel
|
||||
* @author Aleksander Lech
|
||||
* @author Scott Frederick
|
||||
* @since 2.3.2
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class ElasticsearchReactiveHealthIndicator extends AbstractReactiveHealthIndicator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Actuator support for Elasticsearch dependent on Spring Data.
|
||||
* Elasticsearch health integration using Spring Data Elasticsearch.
|
||||
*/
|
||||
package org.springframework.boot.actuate.data.elasticsearch;
|
||||
package org.springframework.boot.data.elasticsearch.actuate.health;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.elasticsearch;
|
||||
package org.springframework.boot.data.elasticsearch.actuate.health;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.Status;
|
||||
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient;
|
||||
@@ -68,6 +68,13 @@ bom {
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Findbugs JSR 305", "3.0.2") {
|
||||
group("com.google.code.findbugs") {
|
||||
modules = [
|
||||
"jsr305"
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Janino", "3.1.12") {
|
||||
group("org.codehaus.janino") {
|
||||
bom("janino") {
|
||||
|
||||
Reference in New Issue
Block a user