wbarnha / kafka-python-ng

Fork for Python client for Apache Kafka
https://wbarnha.github.io/kafka-python-ng/
Apache License 2.0
67 stars 8 forks source link

Add delete records method support for kafka admin api #158

Closed wbarnha closed 6 months ago

wbarnha commented 6 months ago

Hello. Sometimes it might be useful to delete messages from kafka topic without a trick with setting 1 second retention time.

I tried to implement this like in java version of client https://github.com/apache/kafka/blob/f98e176746d663fadedbcd3c18312a7f476a20c8/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java#L2279

For me it solves the problem, hope it can be helpful for somebody.

This change is Reviewable

wbarnha commented 6 months ago

I'm all for adding new features, but it would be nice to have some tests verifying this works.

wbarnha commented 6 months ago

Resuming this in https://github.com/wbarnha/kafka-python-ng/pull/136