164 points · by sauljp · 2y ago · 41 comments
Every time we have to call up our ops guys for this; it’s like “deep breath, first utter some indescribable magic aws iam nonsense and somehow get an ephemeral shell on some rando bitnami Kafka image’s ./kafka-topic shell scripts to work over the next few hours” and ultimately succeed but with deep regrets
[Pro tip: kafka is a piece of shit architecture and actually doesn't provide you with anything better.]
Hmmm interesting. I have only seen people rave about it, but haven't used it myself. Why is it shit architecture?
We use strimzi by default, so we deploy cruise control with kafka, and it takes care of rebalancing the data across the nodes. Also you can deploy it without strimzi.
Delete crap is more complicated, usually with kafka-delete-records (this is king of new I think). The problem is the offsets. By general rule you should not delete data from topics
You have to rewrite the whole topic to do this right? (or do some hacks with compaction if you have unique keys)
https://kafka.apache.org/11/javadoc/org/apache/kafka/clients...
I guess it would be a nice addition to have some kind of FilterableDataTable with history, filtering, caching, and fast rendering
I guess you probably developed something like that for this tool, perhaps you could share it in Textual, or some kind of "textual widgets extension lib"?
This is the drawback: you have to generate the descriptor first.
1) download the schema from schema registry: http :8081/schemas/ids/<my-id>/schema
2) generate the descriptor with the schema: protoc --include_imports --descriptor_set_out=my-descriptor.desc --proto_path=. my-schema.proto
3) use kaskade: kaskade consumer -b my-kafka:9092 -x auto.offset.reset=earliest -k string -v protobuf -t my-protobuf-topic -p descriptor=my-descriptor.desc -p value=mypackage.MyMessage
The only catch (in the protobuf case) is to generate the descriptors with protoc, but the good thing is generally we all have them, so maybe is not a big problem.
See previous discussion here: https://news.ycombinator.com/item?id=29296969
(Edit)
Kaskade models.py, consumer.py https://github.com/sauljabin/kaskade/blob/main/kaskade/model...
kombu/transport/confluentkafka.py: https://github.com/celery/kombu/blob/main/kombu/transport/co...
confluent-kafka-python wraps librdkafka with binary wheels: https://github.com/confluentinc/confluent-kafka-python
librdkafka: https://github.com/edenhill/librdkafka
brew install kaskade
pipx install kaskade
https://terminaltrove.com/kaskade/
For those interested, kaskade is made with the Textual TUI framework.
Thanks for making this sauljp.