Re: Removing kafka topic contents from Java

2016-10-24 Thread sunil kalva
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 wrote: >

Re: Removing kafka topic contents from Java

2016-10-24 Thread Ali Akhtar
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 wrote: >

RE: Removing kafka topic contents from Java

2016-10-24 Thread Tauzell, Dave
There is a script kafka-topics.sh which calls kafka.admin.TopicCommand. I think you could probably call that same class from your application if you figure out which jars are needed. When I do testing I'll clear out queues by setting the retention time to a second and then wait for kafka to