diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfiguration.java index 7f93279fde..2a9b13603f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -37,11 +37,16 @@ import org.springframework.context.annotation.Bean; * * @author Eddú Meléndez * @since 2.0.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new client and its own + * Spring Boot integration. */ +@SuppressWarnings("removal") @AutoConfiguration(after = InfluxDbAutoConfiguration.class) @ConditionalOnClass(InfluxDB.class) @ConditionalOnBean(InfluxDB.class) @ConditionalOnEnabledHealthIndicator("influxdb") +@Deprecated(since = "3.2.0", forRemoval = true) public class InfluxDbHealthContributorAutoConfiguration extends CompositeHealthContributorConfiguration { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfigurationTests.java index 4ed923d504..64d2757f26 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfigurationTests.java @@ -32,6 +32,8 @@ import static org.mockito.Mockito.mock; * * @author Eddú Meléndez */ +@SuppressWarnings("removal") +@Deprecated(since = "3.2.0", forRemoval = true) class InfluxDbHealthContributorAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java index 4896ff6094..f58586fb92 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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. @@ -29,7 +29,11 @@ import org.springframework.util.Assert; * * @author Eddú Meléndez * @since 2.0.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new client and its own + * Spring Boot integration. */ +@Deprecated(since = "3.2.0", forRemoval = true) public class InfluxDbHealthIndicator extends AbstractHealthIndicator { private final InfluxDB influxDb; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicatorTests.java index 367b1ec991..f874582108 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicatorTests.java @@ -36,6 +36,8 @@ import static org.mockito.Mockito.mock; * * @author Eddú Meléndez */ +@SuppressWarnings("removal") +@Deprecated(since = "3.2.0", forRemoval = true) class InfluxDbHealthIndicatorTests { @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java index 5641d51821..904541755a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java @@ -39,11 +39,16 @@ import org.springframework.context.annotation.Bean; * @author Andy Wilkinson * @author Phillip Webb * @since 2.0.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new client and its own + * Spring Boot integration. */ @AutoConfiguration @ConditionalOnClass(InfluxDB.class) @EnableConfigurationProperties(InfluxDbProperties.class) @ConditionalOnProperty("spring.influx.url") +@Deprecated(since = "3.2.0", forRemoval = true) +@SuppressWarnings("removal") public class InfluxDbAutoConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbCustomizer.java index 9e46dd17fa..62f9b0df99 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2023 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. @@ -24,8 +24,12 @@ import org.influxdb.InfluxDB; * * @author Eddú Meléndez * @since 2.5.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new client and its own + * Spring Boot integration. */ @FunctionalInterface +@Deprecated(since = "3.2.0", forRemoval = true) public interface InfluxDbCustomizer { /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java index 67dc383089..14995dba42 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 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. @@ -27,8 +27,12 @@ import org.influxdb.InfluxDB; * * @author Stephane Nicoll * @since 2.1.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new client and its own + * Spring Boot integration. */ @FunctionalInterface +@Deprecated(since = "3.2.0", forRemoval = true) public interface InfluxDbOkHttpClientBuilderProvider extends Supplier { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbProperties.java index d8a4c07d5b..e4fd9d26b1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2023 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. @@ -17,6 +17,7 @@ package org.springframework.boot.autoconfigure.influx; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; /** * Configuration properties for InfluxDB. @@ -24,7 +25,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Sergey Kuptsov * @author Stephane Nicoll * @since 2.0.0 + * @deprecated since 3.2.0 for removal in 3.4.0 in favor of the + * new InfluxDB Java + * client and its own Spring Boot integration. */ +@Deprecated(since = "3.2.0", forRemoval = true) @ConfigurationProperties(prefix = "spring.influx") public class InfluxDbProperties { @@ -43,6 +48,7 @@ public class InfluxDbProperties { */ private String password; + @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") public String getUrl() { return this.url; } @@ -51,6 +57,7 @@ public class InfluxDbProperties { this.url = url; } + @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") public String getUser() { return this.user; } @@ -59,6 +66,7 @@ public class InfluxDbProperties { this.user = user; } + @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") public String getPassword() { return this.password; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java index 7d37ee994c..fade2e3b28 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java @@ -42,6 +42,8 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Andy Wilkinson * @author Phillip Webb */ +@SuppressWarnings("removal") +@Deprecated(since = "3.2.0", forRemoval = true) class InfluxDbAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() @@ -102,6 +104,7 @@ class InfluxDbAutoConfigurationTests { static class CustomOkHttpClientBuilderProviderConfig { @Bean + @SuppressWarnings("removal") InfluxDbOkHttpClientBuilderProvider influxDbOkHttpClientBuilderProvider() { return () -> new OkHttpClient.Builder().readTimeout(40, TimeUnit.SECONDS); } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc index be74814f26..2ffbe9da42 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc @@ -11,7 +11,8 @@ Spring Data provides additional projects that help you access a variety of NoSQL * {spring-data-couchbase}[Couchbase] * {spring-data-ldap}[LDAP] -Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Cassandra, Couchbase, LDAP and InfluxDB. +Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Cassandra, Couchbase, LDAP. +Auto-configuration for InfluxDB is also provided but it is deprecated in favor of https://github.com/influxdata/influxdb-client-java[the new InfluxDB Java client] that provides its own Spring Boot integration. Additionally, {spring-boot-for-apache-geode}[Spring Boot for Apache Geode] provides {spring-boot-for-apache-geode-docs}#geode-repositories[auto-configuration for Apache Geode]. You can make use of the other projects, but you must configure them yourself. See the appropriate reference documentation at {spring-data}. @@ -637,22 +638,17 @@ If you have custom attributes, you can use configprop:spring.ldap.embedded.valid [[data.nosql.influxdb]] === InfluxDB +WARNING: Auto-configuration for InfluxDB is deprecated and scheduled for removal in Spring Boot 3.4 in favor of https://github.com/influxdata/influxdb-client-java[the new InfluxDB Java client] that provides its own Spring Boot integration. + https://www.influxdata.com/[InfluxDB] is an open-source time series database optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet-of-Things sensor data, and real-time analytics. [[data.nosql.influxdb.connecting]] ==== Connecting to InfluxDB -Spring Boot auto-configures an `InfluxDB` instance, provided the `influxdb-java` client is on the classpath and the URL of the database is set, as shown in the following example: +Spring Boot auto-configures an `InfluxDB` instance, provided the `influxdb-java` client is on the classpath and the URL of the database is set using configprop:spring.influx.url[deprecated]. -[source,yaml,indent=0,subs="verbatim",configprops,configblocks] ----- - spring: - influx: - url: "https://172.0.0.1:8086" ----- - -If the connection to InfluxDB requires a user and password, you can set the `spring.influx.user` and `spring.influx.password` properties accordingly. +If the connection to InfluxDB requires a user and password, you can set the configprop:spring.influx.user[deprecated] and configprop:spring.influx.password[deprecated] properties accordingly. InfluxDB relies on OkHttp. If you need to tune the http client `InfluxDB` uses behind the scenes, you can register an `InfluxDbOkHttpClientBuilderProvider` bean.