...
So, this KIP try to reach the goal we can change the max.block.ms to wanted smaller value without worry about the metadata's fetch.
Public Interfaces
No public interface changed. Just change the inner implement of private method:
org.apache.kafka.clients.producer.KafkaProducer#doSend
...
The changes can refer to the example PR: https://github.com/apache/kafka/pull/13335/files
Add two configures with tiny code changes related which control the timeout in KafkaProducer#send
1. Two configures added
Producer's configure. | configure item. | default value
|
includeWaitTimeOnMetadataInMaxBlockTime | max.block.ms.include.metadata | false |
maxWaitTimeMsOnMetadata | max.block.metadata.ms | <max.block.ms |
...
Case 2 and case 5 will fail to send records. Others All of others are success one.
Rejected Alternatives
Alternative 1:
...