Anish
Anish

Reputation: 114

Create duplicate topic in kafka using python

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

Answers (1)

OneCricketeer
OneCricketeer

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

Related Questions