ijuma commented on code in PR #7283:
URL: https://github.com/apache/kafka/pull/7283#discussion_r850452641
##########
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java:
##########
@@ -1053,6 +1048,14 @@ private ClusterAndWaitTime waitOnMetadata(String topic,
Integer partition, long
return new ClusterAndWaitTime(cluster, elapsed);
}
+ private TimeoutException timeoutForAbsentMetadata(String topic, Integer
partition, long maxWaitMs, Integer partitionsCount) {
+ return new TimeoutException(partitionsCount == null ?
+ String.format("Topic %s not present in metadata after %d ms.",
+ topic, maxWaitMs) :
+ String.format("Partition %d of topic %s with partition count
%d is not present in metadata after %d ms.",
+ partition, topic, partitionsCount, maxWaitMs));
Review Comment:
Should we set a cause to the `TimeoutException` to make it easy to
programmatically handle the case where the topic or partition doesn't exist (vs
all other reasons why `TimeoutException` may be thrown).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]