How to configure kafka topic retention policy during creation with Spring?

后端 未结 3 1034
耶瑟儿~
耶瑟儿~ 2020-12-19 16:10

I need to configure retention policy of a particular topic during creation. I tried to look for solution i could only find command level alter command as below

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 16:41

    I guess you could use admin client (https://kafka.apache.org/22/javadoc/index.html?org/apache/kafka/clients/admin/AdminClient.html) for this. You can create Admin client instance in your application and use create or alter topic command for manipulating topic configurations, including retention.

提交回复
热议问题