| | |
| | | package com.zy.influxdb.config; |
| | | |
| | | import com.influxdb.v3.client.InfluxDBClient; |
| | | import com.influxdb.client.InfluxDBClient; |
| | | import com.influxdb.client.InfluxDBClientFactory; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | |
| | | |
| | | @Bean(destroyMethod = "close") |
| | | public InfluxDBClient influxDBClient(InfluxDBProperties influxDBProperties) throws Exception{ |
| | | return InfluxDBClient.getInstance(influxDBProperties.getInfluxDbUrl(), influxDBProperties.getToken().toCharArray(), influxDBProperties.getDatabase()); |
| | | return InfluxDBClientFactory.create(influxDBProperties.getUrl(), influxDBProperties.getToken().toCharArray(), influxDBProperties.getDatabase()); |
| | | } |
| | | } |