last day (14 days later) » 

10:39 AM
1
A: Update TTL for a particular topic in kafka using Java

ppatiernoYou can do that using the AdminClient, following a snippet of code that get the current configuration (just for testing) and then update the "retention.ms" config on the topic named "test". Properties props = new Properties(); props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localh...

 
Thanks for response, not able to get these classes info ( AdminClient, DescribeConfigsResult, AlterConfigsResult, ConfigEntry), I am using pom not getting import statements
 
Are you using the 0.11.0 release ? I'm using this one. The AdminClient API was introduced with latest version otherwise you can't do that from Java code.
 
<dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.10</artifactId> <version>0.8.0</version> </dependency> I tried with 0.11.0 also but didnt work for me
 
I have uploaded my code on this github repo : github.com/ppatierno/kafka-playground
Btw you need "kafka-clients" as artifactId not "kafka_2.10"
 
here new ConfigEntry(TopicConfig.RETENTION_MS_CONFIG, "50000") 50000 is the time in seconds? I mean suppose If I want for 10 days then I have to give 864000.
 
10:39 AM
the properties is retention.ms ... it's in milliseconds
 
org.apache.kafka.common.errors.UnsupportedVersionException: The broker does not support DESCRIBE_CONFIGS getting this exception while running the class
 
Even the broker should be 0.11.0 version
 
how to set broker version ?
where I can set the broker version?
 
it's not something to set. What is the version of the broker you are connecting to ?
 
I don't know, our seniors have given kafka server IPs to connect, I am directly connecting to it instead of localhost i am using IP like 12.456.456.89 this is not exact IP but something like this
is there any way to know the broker version id?
 
10:53 AM
you have to ask them
 
11:17 AM
they are not here....
they are on site people
 
 
3 hours later…
1:53 PM
can we update the TTL directly in kafka using any commands?
 

last day (14 days later) »