@@ -17,7 +17,7 @@ To use Redis multi-data sources, you need to add the Redis Multi Sources Spring
1717<dependency>
1818 <groupId>com.childrengreens</groupId>
1919 <artifactId>redis-multi-source-spring-boot-starter</artifactId>
20- <version>2.2 </version>
20+ <version>2.3 </version>
2121</dependency>
2222----
2323To use Jedis instead of Lettuce as the client, you need to add the following dependencies:
@@ -139,7 +139,7 @@ To use RabbitMQ multi-data sources, you need to add the AMQP Multi Sources Sprin
139139<dependency>
140140 <groupId>com.childrengreens</groupId>
141141 <artifactId>amqp-multi-source-spring-boot-starter</artifactId>
142- <version>2.2 </version>
142+ <version>2.3 </version>
143143</dependency>
144144----
145145Add the following configuration to your properties file.
@@ -212,6 +212,73 @@ private SimpleRabbitListenerContainerFactory simpleRabbitListenerContainerFactor
212212
213213----
214214
215+
216+ === InfluxDB2 Multi Data Sources
217+ To use InfluxDB2 multi-data sources, you need to add the Influx2 Multi Sources Spring Boot Starter dependency to your project.
218+ [source,xml]
219+ ----
220+ <dependency>
221+ <groupId>com.childrengreens</groupId>
222+ <artifactId>influx2-multi-source-spring-boot-starter</artifactId>
223+ <version>2.3</version>
224+ </dependency>
225+ ----
226+ Add the following configuration to your properties file.
227+ [source,properties]
228+ ----
229+ # set the primary-key data source (must)
230+ spring.multi-sources.influx.primary-key=cn
231+
232+ # cn data source
233+ spring.multi-sources.influx.sources.cn.url=http://127.0.0.1:8086/
234+ spring.multi-sources.influx.sources.cn.token=wkOEKEVJ4jJBUhTwzKLsFVTpqR_JsGR3w6ybS3xTDy67WSaY14W4HQf59r69pX0YDaboNDRo_SrMa_T3clNMPA==
235+ spring.multi-sources.influx.sources.cn.org=cn-market-data
236+ spring.multi-sources.influx.sources.cn.bucket=cn-data
237+
238+ # hk data source
239+ spring.multi-sources.influx.sources.hk.url=http://127.0.0.2:8086/
240+ spring.multi-sources.influx.sources.hk.token=wkOEKEVJ4jJBUhTwzKLsFVTpqR_JsGR3w6ybS3xTDy67WSaY14W4HQf59r69pX0YDaboNDRo_FkMa_T3clNMPA==
241+ spring.multi-sources.influx.sources.hk.org=hk-market-data
242+ spring.multi-sources.influx.sources.hk.bucket=hk-data
243+
244+ ----
245+
246+
247+ [source,yml]
248+ ----
249+ # set the primary-key data source (must)
250+ spring:
251+ multi-sources:
252+ influx:
253+ primary-key: cn
254+
255+ # cn data source
256+ sources:
257+ cn:
258+ url: http://127.0.0.1:8086/
259+ token: wkOEKEVJ4jJBUhTwzKLsFVTpqR_JsGR3w6ybS3xTDy67WSaY14W4HQf59r69pX0YDaboNDRo_SrMa_T3clNMPA==
260+ org: cn-market-data
261+ bucket: cn-data
262+
263+ # hk data source
264+ hk:
265+ url: http://127.0.0.2:8086/
266+ token: wkOEKEVJ4jJBUhTwzKLsFVTpqR_JsGR3w6ybS3xTDy67WSaY14W4HQf59r69pX0YDaboNDRo_FkMa_T3clNMPA==
267+ org: hk-market-data
268+ bucket: hk-data
269+ ----
270+ === InfluxDB2 Multi Source Runtime
271+ Influx2 Multi Sources Spring Boot Starter will create multiple `InfluxDBClient` bean based on the configuration and register them in the Spring container.
272+
273+ The naming convention for the bean names is: `sourceName` + `className`. Therefore, the usage is as follows:
274+ [source,java]
275+ ----
276+ @Autowired
277+ @Qualifier("cnInfluxDBClient")
278+ private InfluxDBClient influxDBClient;
279+
280+ ----
281+
215282== License
216283
217284Spring Boot is Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].
0 commit comments