Open polarnik opened 1 year ago
Workaround with org.influxdb:influxdb-java:2.23
//Point from https://github.com/influxdata/influxdb-client-java
import com.influxdb.client.write.Point;
// Client from https://github.com/influxdata/influxdb-java
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
...
final InfluxDB influxDB = InfluxDBFactory.connect(InfluxDBAddress, Username, Password);
influxDB.setDatabase(DataBase);
influxDB.setRetentionPolicy(RetentionPolicy);
InfluxLineGenerator influxLineGenerator = new InfluxLineGenerator(); // Some generator
ArrayList<Point> points = influxLineGenerator.getPointList();
for(Point point: points) {
influxDB.write(DataBase, RetentionPolicy, InfluxDB.ConsistencyLevel.ALL, TimeUnit.MILLISECONDS,
point.toLineProtocol());
}
influxDB.close();
Gradle config:
implementation("org.influxdb:influxdb-java:2.23")
implementation("com.influxdb:influxdb-client-java:6.8.0")
Some important case:
InfluxDB 1.8 POST /write - we will see the 2nd point in the DB InfluxDB 2.6.1 POST /write - we will see the all points in the DB
Steps to reproduce: List the minimal actions needed to reproduce the behavior.
UserName
and password:Password
DataBase
and retention policyauto
Expected behavior: HTTP request via https://docs.influxdata.com/influxdb/v2.7/reference/api/influxdb-1x/write/ HTTP request:
Actual behavior: HTTP request:
It doesn't work. Only 401 Errors.
Specifications:
Workaround: Use https://github.com/influxdata/influxdb-java instead of https://github.com/influxdata/influxdb-client-java for working with v1