erlkaf
erlkaf copied to clipboard
Support deleting topics
trafficstars
It would be useful for cleaning up the state of the broker when using erlkaf in tests that produce to random topics that we are not really interested to be long lived.
For example:
setup_all do
:erlkaf.create_producer(TestProducer, [])
topic = "random_test_topic_#{Ecto.UUID.generate()}"
:ok = :erlkaf.create_topic(TestProducer, topic)
on_exit(fn ->
:erlkaf.delete_topic(TestProducer, topic)
:erlkaf.stop_client(TestProducer)
end)
end
Pardon my Elixir.
This can be implemented. The native function for delete topic is here: https://github.com/confluentinc/librdkafka/blob/1f9f245ac409f50f724695c628c7a0d54a763b9a/src/rdkafka.h#L5574
Unfortunately my time is very limited . so a pull request is welcome !
Silviu