kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Akhtar <ali.rac...@gmail.com>
Subject Re: How to create a topic using the Java API / Client?
Date Thu, 15 Sep 2016 00:43:01 GMT
Thank you  Martin

On 15 Sep 2016 3:05 am, "Mathieu Fenniak" <mathieu.fenniak@replicon.com>
wrote:

> Hey Ali,
>
> If you have auto create turned on, which it sounds like you do, and you're
> happy with using the broker's configured partition count and replication
> factor, then you can call "partitionsFor(String topic)" on your producer.
> This will create the topic without sending a message to it.  I'm not sure
> it's 100% smart, but I found it to be better than the alternatives I could
> find. :-)
>
> Mathieu
>
>
> On Wed, Sep 14, 2016 at 3:41 PM, Ali Akhtar <ali.rac200@gmail.com> wrote:
>
> > It looks like if I just send a message to a non-existent topic, it is
> > created. But this has the downside that the first message of the topic is
> > null or otherwise invalid.
> >
> > Also the partition count can't be specified.
> >
> > Is there a way to create a topic without needing to post a null message?
> Do
> > I need to talk to the bash script?
> >
> > On Wed, Sep 14, 2016 at 8:45 AM, Ali Akhtar <ali.rac200@gmail.com>
> wrote:
> >
> > > Using version 0.10.0.1, how can I create kafka topics using the java
> > > client / API?
> > >
> > > Stackoverflow answers describe using kafka.admin.AdminUtils, but this
> > > class is not included in the kafka-clients maven dependency. I also
> don't
> > > see the package kafka.admin in the javadocs: http://kafka.apache.
> > > org/0100/javadoc/index.html?org/apache/kafka/clients/produce
> > > r/KafkaProducer.html
> > >
> > >
> > > What am I missing?
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message