Import data from Influxdb_V2 to Spring Boot application

236 views Asked by At

I am trying to fetch data from influxdb(version 2) bucket into my Spring Boot application. I have not found any references on google to implement this feature. Can anyone help me in this my providing any references or documentation so I can implement this feature.

1

There are 1 answers

0
Prajyod Kumar On BEST ANSWER
String token = "tokenDetails";
        String bucket = "test123";
        String org = "test";
        InfluxDBClient client = InfluxDBClientFactory.create("https:localhost:8086/",
                token.toCharArray());

        String query = String.format("from(bucket: \"%s\") |> range(start: -15m)", bucket);
        List<FluxTable> tables = client.getQueryApi().query(query, org);

Iterate on tables and records to operate on data.