You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by UMESH CHAUDHARY <um...@gmail.com> on 2016/09/22 08:09:28 UTC

Unable to locate auto.create.topics.enable=true path for KafkaProducer

Hi Mates,
I was trying to understand that if auto.create.topics.enable=true then how
KafkaProducer first creates the topic and sends messages to it.

What I saw:

private Future<RecordMetadata> doSend(ProducerRecord<K, V> record, Callback
callback)

method in KafkaProducer.java.

What I failed to get:

When getting metadata for topic using

            ClusterAndWaitTime clusterAndWaitTime =
waitOnMetadata(record.topic(), this.maxBlockTimeMs);
line, I am failed to locate the path where we don't have any metadata for
the topic i.e. topic doesn't exist and according to
"auto.create.topics.enable=true" KafkaProducer invokes createTopic before
sending the record.

It works flawlessly with clients so it must be coded somewhere. I also saw
MockProducerTest.java but unable to locate.

I am a newbie so please forgive for any stupidity here.

Regards,
Umesh

Re: Unable to locate auto.create.topics.enable=true path for KafkaProducer

Posted by "Thakrar, Jayesh" <jt...@conversantmedia.com>.
Umesh, 

That is a Kafka broker level config/parameter and not part of the producer.

Jayesh


On 9/22/16, 3:09 AM, "UMESH CHAUDHARY" <um...@gmail.com> wrote:

    Hi Mates,
    I was trying to understand that if auto.create.topics.enable=true then how
    KafkaProducer first creates the topic and sends messages to it.
    
    What I saw:
    
    private Future<RecordMetadata> doSend(ProducerRecord<K, V> record, Callback
    callback)
    
    method in KafkaProducer.java.
    
    What I failed to get:
    
    When getting metadata for topic using
    
                ClusterAndWaitTime clusterAndWaitTime =
    waitOnMetadata(record.topic(), this.maxBlockTimeMs);
    line, I am failed to locate the path where we don't have any metadata for
    the topic i.e. topic doesn't exist and according to
    "auto.create.topics.enable=true" KafkaProducer invokes createTopic before
    sending the record.
    
    It works flawlessly with clients so it must be coded somewhere. I also saw
    MockProducerTest.java but unable to locate.
    
    I am a newbie so please forgive for any stupidity here.
    
    Regards,
    Umesh