influxdb-client-java icon indicating copy to clipboard operation
influxdb-client-java copied to clipboard

Java Clinet lost connection

Open alpha3171 opened this issue 2 years ago • 3 comments
trafficstars

When I use java client, version 5.0.0. When the server run after a period , I found the point has not been writen to db. And there are not any exception logs. Then , i use command "netstat -apntl | grep 8086" ,find none. Could you tell me how to fix it. thanks.

I use token to auth.

init code is :

influxDBClients = InfluxDBClientFactory.create(address, token.toCharArray());
writeApis = influxDBClients.makeWriteApi(WriteOptions.builder().batchSize(128).flushInterval(3000).build());

and call in another function

writeApi = getApi();
Point point = Point.measurement(measurement).addTags(tags);
writeApi.writePoint("bucket1", "xxxx", point);

alpha3171 avatar Jan 11 '23 07:01 alpha3171

Hi,

Were you able to resolve your issue? Are you closing the client or the writeapi? Take a look at the response in this other issue: https://github.com/influxdata/influxdb-client-java/issues/469

powersj avatar Mar 27 '23 19:03 powersj

Hi,

Were you able to resolve your issue? Are you closing the client or the writeapi? Take a look at the response in this other issue: #469

thanks for your response. my issue has not been resolved. I use token to connect influxdb. And this issue happened accidentally, But if it happend, my server can write any data into the influxdb , even restart the server app, it not work too.

alpha3171 avatar Mar 28 '23 01:03 alpha3171

Have you tried the example in the issue I linked to as an alternative?

powersj avatar Mar 28 '23 13:03 powersj