UnauthorizedException after a while when connecting with influxdb-java [influxdb v2.0]

We run an influxdb-java code that sinks data from kafka into the influxdb v2.0 database. The code works fine for a while (copple of days) and then suddenly throws the UnauthorizedException.

SEVERE: The error occurred during writing of data

com.influxdb.exceptions.UnauthorizedException: unauthorized access at
com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:98) at
com.influxdb.client.internal.AbstractWriteClient.toInfluxException(AbstractWriteClient.java:533) at
com.influxdb.client.internal.AbstractWriteClient.lambda$new$7(AbstractWriteClient.java:155) at
io.reactivex.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65) at
io.reactivex.internal.operators.mixed.FlowableConcatMapMaybe$ConcatMapMaybeSubscriber.drain(FlowableConcatMapMaybe.java:284) at
io.reactivex.internal.operators.mixed.FlowableConcatMapMaybe$ConcatMapMaybeSubscriber.onNext(FlowableConcatMapMaybe.java:137) at
io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber.drain(FlowableConcatMapSingle.java:279) at
io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber.innerSuccess(FlowableConcatMapSingle.java:179) at
io.reactivex.internal.operators.mixed.FlowableConcatMapSingle$ConcatMapSingleSubscriber$ConcatMapSingleObserver.onSuccess(FlowableConcatMapSingle.java:317) at
io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64) at
io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64) at
io.reactivex.internal.operators.flowable.FlowableCollectSingle$CollectSubscriber.onComplete(FlowableCollectSingle.java:119) at
io.reactivex.internal.subscribers.BasicFuseableSubscriber.onComplete(BasicFuseableSubscriber.java:120) at
io.reactivex.internal.subscribers.BasicFuseableConditionalSubscriber.onComplete(BasicFuseableConditionalSubscriber.java:119) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$State.checkTerminated(FlowableGroupBy.java:687) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$State.drainNormal(FlowableGroupBy.java:627) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$State.drain(FlowableGroupBy.java:559) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$State.onComplete(FlowableGroupBy.java:549) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$GroupedUnicast.onComplete(FlowableGroupBy.java:475) at
io.reactivex.internal.operators.flowable.FlowableGroupBy$GroupBySubscriber.onComplete(FlowableGroupBy.java:213) at
io.reactivex.processors.UnicastProcessor.checkTerminated(UnicastProcessor.java:431) at
io.reactivex.processors.UnicastProcessor.drainRegular(UnicastProcessor.java:314) at
io.reactivex.processors.UnicastProcessor.drain(UnicastProcessor.java:398) at
io.reactivex.processors.UnicastProcessor.onComplete(UnicastProcessor.java:488) at
io.reactivex.internal.operators.flowable.FlowableWindowBoundary$WindowBoundaryMainSubscriber.drain(FlowableWindowBoundary.java:237) at
io.reactivex.internal.operators.flowable.FlowableWindowBoundary$WindowBoundaryMainSubscriber.innerNext(FlowableWindowBoundary.java:149) at
io.reactivex.internal.operators.flowable.FlowableWindowBoundary$WindowBoundaryInnerSubscriber.onNext(FlowableWindowBoundary.java:281) at
io.reactivex.processors.PublishProcessor$PublishSubscription.onNext(PublishProcessor.java:360) at
io.reactivex.processors.PublishProcessor.onNext(PublishProcessor.java:243) at
io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.tryEmit(FlowableFlatMap.java:282) at
io.reactivex.internal.operators.flowable.FlowableFlatMap$InnerSubscriber.onNext(FlowableFlatMap.java:663) at
io.reactivex.processors.PublishProcessor$PublishSubscription.onNext(PublishProcessor.java:360) at io.reactivex.processors.PublishProcessor.offer(PublishProcessor.java:301) at
com.influxdb.client.internal.AbstractWriteClient.flush(AbstractWriteClient.java:171) at
PACKAGE.influxdb.sink.KafkaInfluxdbSink.transferData(KafkaInfluxdbSink.java:104) at
PACKAGE.influxdb.MainService.main(MainService.java:19)

Question: is there anyone else facing this difficulty and is there a timeout in the influxdb-java client authentication process. Because I found nothing in the influxdb documentation of the v1.7 and the v2.0 documentation seems not ready yet.

See the SO question related: SO

This looks like it might be a bug in the client library, could you open an issue on GitHub?