Are you looking something like this String command = String.format("--delete --zookeeper %s --topic %s", "localhost:2181", "test_topic"); String[] split = command.split(" "); TopicCommand.main(split);
t SunilKalva On Mon, Oct 24, 2016 at 9:09 PM, Ali Akhtar <ali.rac...@gmail.com> wrote: > There isn't a java API for this, you'd have to mess around with bash > scripts which I haven't found to be worth it. > > Just let the data expire and get deleted. Set a short expiry time for the > topic if necessary. > > > On Mon, Oct 24, 2016 at 6:30 PM, Demian Calcaprina <calcacue...@gmail.com> > wrote: > > > Hi Guys, > > > > Is there a way to remove a kafka topic from the java api? > > > > I have the following scenario: > > We have a subscription service, which returns responses to subscribed > > clients through kafka topic. Per subscription, we create a new kafka > topic > > and send the data by publishing in this new topic. And, when the > > subscription ends, this topic is not needed anymore, so I would like to > > purge it so that it does not store data it will not be used anymore. > > Does it make sense? > > > > Thanks! > > > > Demian > > > -- SunilKalva