Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10620

Ensure Topic Metadata loaded just after create KafkaProducer

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: clients, producer
    • Labels:
      None

      Description

      Seems KafkaProducer neither expose API nor config properties to actively init (or wait for) topic Metadata, which will lead to send message failed at the beginning if use short `max.block.ms`.

      TimeoutException...
      Topic XXX not present in metadata after XXX ms.

      I reproduced the issue in kafka-clients-2.1.1.jar, and check the latest version doc nothing changed related.

      Thread.sleep can be a temporary work around, just wonder any better solutions.

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              atealxt Suo L.
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: