Reputation: 114
Is there a way we can create a copy of the kafka topic using kafka-python package? I am trying to create a backup of a topic before performing few operations on the data.
Upvotes: 0
Views: 228
Reputation: 191884
It's not possible to backup a topic without consuming the whole thing as binary data, then writing it back. Ideally, you'd use something like MirrorMaker for this ( built into Kafka) rather than Python
Unclear what operations you need to perform, but the data in the topic is immutable, so nothing you're doing will change it
Otherwise, yes, you can use the AdminClient API to create/delete topics programmatically to "duplicate a topic with settings" before "backing up" another topic into it
Upvotes: 1