A side note is that you may want to use waitUntil to check the topic is
created after using AdminUtils.createTopic since it is async.

On Mon, Oct 13, 2014 at 10:07 AM, Jonathan Weeks <jonathanbwe...@gmail.com>
wrote:

> Sure — take a look at the kafka unit tests as well as admin.AdminUtils ,
> e.g.:
>
>     import kafka.admin.AdminUtils
>    AdminUtils.createTopic(zkClient, topicNameString, 10, 1)
>
> Best Regards,
>
> -Jonathan
>
> On Oct 13, 2014, at 9:58 AM, hsy...@gmail.com wrote:
>
> > Hi guys,
> >
> > Besides TopicCommand, which I believe is not provided to create topic
> > programmatically, is there any other way to automate creating topic in
> > code? Thanks!
> >
> > Best,
> > Siyuan
>
>


-- 
-- Guozhang

Reply via email to