Skip to content

Commit 3affb33

Browse files
committed
Deprecate auto-configuration for InfluxDB
Closes gh-35190
1 parent 5022e12 commit 3affb33

File tree

10 files changed

+48
-15
lines changed

10 files changed

+48
-15
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfiguration.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,11 +37,16 @@
3737
*
3838
* @author Eddú Meléndez
3939
* @since 2.0.0
40+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
41+
* <a href="https://github.com/influxdata/influxdb-client-java">new client</a> and its own
42+
* Spring Boot integration.
4043
*/
44+
@SuppressWarnings("removal")
4145
@AutoConfiguration(after = InfluxDbAutoConfiguration.class)
4246
@ConditionalOnClass(InfluxDB.class)
4347
@ConditionalOnBean(InfluxDB.class)
4448
@ConditionalOnEnabledHealthIndicator("influxdb")
49+
@Deprecated(since = "3.2.0", forRemoval = true)
4550
public class InfluxDbHealthContributorAutoConfiguration
4651
extends CompositeHealthContributorConfiguration<InfluxDbHealthIndicator, InfluxDB> {
4752

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/influx/InfluxDbHealthContributorAutoConfigurationTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
*
3333
* @author Eddú Meléndez
3434
*/
35+
@SuppressWarnings("removal")
36+
@Deprecated(since = "3.2.0", forRemoval = true)
3537
class InfluxDbHealthContributorAutoConfigurationTests {
3638

3739
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,11 @@
2929
*
3030
* @author Eddú Meléndez
3131
* @since 2.0.0
32+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
33+
* <a href="https://github.com/influxdata/influxdb-client-java">new client</a> and its own
34+
* Spring Boot integration.
3235
*/
36+
@Deprecated(since = "3.2.0", forRemoval = true)
3337
public class InfluxDbHealthIndicator extends AbstractHealthIndicator {
3438

3539
private final InfluxDB influxDb;

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/influx/InfluxDbHealthIndicatorTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
*
3737
* @author Eddú Meléndez
3838
*/
39+
@SuppressWarnings("removal")
40+
@Deprecated(since = "3.2.0", forRemoval = true)
3941
class InfluxDbHealthIndicatorTests {
4042

4143
@Test

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@
3939
* @author Andy Wilkinson
4040
* @author Phillip Webb
4141
* @since 2.0.0
42+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
43+
* <a href="https://github.com/influxdata/influxdb-client-java">new client</a> and its own
44+
* Spring Boot integration.
4245
*/
4346
@AutoConfiguration
4447
@ConditionalOnClass(InfluxDB.class)
4548
@EnableConfigurationProperties(InfluxDbProperties.class)
4649
@ConditionalOnProperty("spring.influx.url")
50+
@Deprecated(since = "3.2.0", forRemoval = true)
51+
@SuppressWarnings("removal")
4752
public class InfluxDbAutoConfiguration {
4853

4954
@Bean

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbCustomizer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,12 @@
2424
*
2525
* @author Eddú Meléndez
2626
* @since 2.5.0
27+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
28+
* <a href="https://github.com/influxdata/influxdb-client-java">new client</a> and its own
29+
* Spring Boot integration.
2730
*/
2831
@FunctionalInterface
32+
@Deprecated(since = "3.2.0", forRemoval = true)
2933
public interface InfluxDbCustomizer {
3034

3135
/**

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,8 +27,12 @@
2727
*
2828
* @author Stephane Nicoll
2929
* @since 2.1.0
30+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
31+
* <a href="https://github.com/influxdata/influxdb-client-java">new client</a> and its own
32+
* Spring Boot integration.
3033
*/
3134
@FunctionalInterface
35+
@Deprecated(since = "3.2.0", forRemoval = true)
3236
public interface InfluxDbOkHttpClientBuilderProvider extends Supplier<OkHttpClient.Builder> {
3337

3438
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbProperties.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,14 +17,19 @@
1717
package org.springframework.boot.autoconfigure.influx;
1818

1919
import org.springframework.boot.context.properties.ConfigurationProperties;
20+
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
2021

2122
/**
2223
* Configuration properties for InfluxDB.
2324
*
2425
* @author Sergey Kuptsov
2526
* @author Stephane Nicoll
2627
* @since 2.0.0
28+
* @deprecated since 3.2.0 for removal in 3.4.0 in favor of the
29+
* <a href="https://github.com/influxdata/influxdb-client-java">new InfluxDB Java
30+
* client</a> and its own Spring Boot integration.
2731
*/
32+
@Deprecated(since = "3.2.0", forRemoval = true)
2833
@ConfigurationProperties(prefix = "spring.influx")
2934
public class InfluxDbProperties {
3035

@@ -43,6 +48,7 @@ public class InfluxDbProperties {
4348
*/
4449
private String password;
4550

51+
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration")
4652
public String getUrl() {
4753
return this.url;
4854
}
@@ -51,6 +57,7 @@ public void setUrl(String url) {
5157
this.url = url;
5258
}
5359

60+
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration")
5461
public String getUser() {
5562
return this.user;
5663
}
@@ -59,6 +66,7 @@ public void setUser(String user) {
5966
this.user = user;
6067
}
6168

69+
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration")
6270
public String getPassword() {
6371
return this.password;
6472
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
* @author Andy Wilkinson
4343
* @author Phillip Webb
4444
*/
45+
@SuppressWarnings("removal")
46+
@Deprecated(since = "3.2.0", forRemoval = true)
4547
class InfluxDbAutoConfigurationTests {
4648

4749
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
@@ -102,6 +104,7 @@ private int getReadTimeoutProperty(AssertableApplicationContext context) {
102104
static class CustomOkHttpClientBuilderProviderConfig {
103105

104106
@Bean
107+
@SuppressWarnings("removal")
105108
InfluxDbOkHttpClientBuilderProvider influxDbOkHttpClientBuilderProvider() {
106109
return () -> new OkHttpClient.Builder().readTimeout(40, TimeUnit.SECONDS);
107110
}

spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Spring Data provides additional projects that help you access a variety of NoSQL
1111
* {spring-data-couchbase}[Couchbase]
1212
* {spring-data-ldap}[LDAP]
1313

14-
Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Cassandra, Couchbase, LDAP and InfluxDB.
14+
Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Cassandra, Couchbase, LDAP.
15+
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.
1516
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].
1617
You can make use of the other projects, but you must configure them yourself.
1718
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
637638

638639
[[data.nosql.influxdb]]
639640
=== InfluxDB
641+
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.
642+
640643
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.
641644

642645

643646

644647
[[data.nosql.influxdb.connecting]]
645648
==== Connecting to InfluxDB
646-
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:
647-
648-
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
649-
----
650-
spring:
651-
influx:
652-
url: "https://172.0.0.1:8086"
653-
----
649+
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].
654650

655-
If the connection to InfluxDB requires a user and password, you can set the `spring.influx.user` and `spring.influx.password` properties accordingly.
651+
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.
656652

657653
InfluxDB relies on OkHttp.
658654
If you need to tune the http client `InfluxDB` uses behind the scenes, you can register an `InfluxDbOkHttpClientBuilderProvider` bean.

0 commit comments

Comments
 (0)