Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
There are some parts of the code making use of the KafkaConsume.poll(long) outside of the specified contract of the API.
This method, which is now deprecated, due to KIP-266 in favor of KafkaConsume.poll(Duration) .
The key item in this deprecation is that the usage of poll(0) in order to force metadata updates may cause the code to block indefinitely.
In addition to the risk of blocking, there's no guarantee that the behavior will remain the same in future versions of the Kafka Client since this is outside of the contract.
The consumer may also block indefinitely: https://github.com/apache/camel/blob/camel-3.11.1/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java#L298-L335