vert-x3 / vertx-kafka-client

Reactive Kafka Client for Vert.x
Apache License 2.0
84 stars 83 forks source link

Remove unnecessary timer #243

Closed aesteve closed 1 year ago

aesteve commented 1 year ago

The call to Kafka producer's partitionFor will fail when max.block.ms duration is reached. Fixes #59 and replaces #121

Motivation:

Not sure why this setTimer had been implemented in the first place, maybe max.block.ms did not exist at the time, but this is no longer needed.

Calls to producer.send(...) producer.partitionsFor(...) are subject to the max.block.ms configuration parameter, and a TimeoutException will be fired past this duration.

Although the failure no longer gets fired twice (like mentioned before in #59 ), it could introduce some issue in cases the cluster is slow, or network is slow. Say an user HAS to configure max.block.ms to a value greater than 2000, the hardcoded setTimer would fire BEFORE max.block.ms gets reached, which could block some users.