xitonix / trubka Goto Github PK
View Code? Open in Web Editor NEWA CLI tool for Kafka
License: Apache License 2.0
A CLI tool for Kafka
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
It would be nice to have a --to
parameter in the consumer.
One benefit is that you can pipe your consumed messages to a file and the consumer will finish once the --to
condition is reached.
Another benefit is that if you're searching through messages, it allows you to narrow your search.
Describe the solution you'd like
The ability to stop consuming by timestamp, by latest offset at the time of starting the consumer, and/or by specific offsets by partition.
For example you could consume messages between 3pm and 4pm like:
$ trubka consume plain <topic name> --brokers <broker:port> --from 22-02-2020T15:00:00 --to 22-02-2020T16:00:00
Or you could consume messages from 3pm until now like:
$ trubka consume plain <topic name> --brokers <broker:port> --from 22-02-2020T15:0:00 --to newest
Is your feature request related to a problem? Please describe.
When using trubka consume proto
if you have a protobuf with a field of type bytes
, the field will be formatted as base64, but I would like to look at them in hex string format. There is an option to format your entire message as hex using -F hex
but not just bytes fields.
Describe the solution you'd like
An option to output in -F json-indent
format, but with individual fields of type bytes
as hex strings.
For example adding a flag --bytes-format [base64|hex]
.
You could take this concept even further and have custom formatting for any type with some kind of configuration file. For example you may want timestamps in a different format as well.
I am wanting to be explicit about the partition key when publishing with trubka and I have not been able to figure out how I can specify that
Consider adding JSON output format. For better or worse it's now the standard data interchange, and with tools like jq
is easily manipulated, filtered, etc. This would be especially useful for creating input to tools like kafka-reassign-partitions.sh
. For reference here's what that looks like, first for input to --topics-to-move-json-file
:
{
"topics": [
{
"topic": "topic1"
},
{
"topic": "topic2"
},
{
"topic": "topic3"
}
],
"version": 1
}
Then for input to --reassignment-json-file
:
{
"version": 1,
"partitions": [
{
"topic": "topic1",
"partition": 0,
"replicas": [1, 2],
"log_dirs": ["any","any"]
},
{
"topic": "topic2",
"partition": 0,
"replicas": [2, 3],
"log_dirs": ["any","any"]
},
{
"topic": "topic3",
"partition": 0,
"replicas": [1, 3],
"log_dirs": ["any","any"]
}
]
}
Thanks for making this one, really neat!
Is there a way to get the lag per topic?
Thanks!
Hi, nice work. It would be great if it would be able to read and write avro format as well.
Plain text output is often very useful, and allows for output to be piped to standard unix tools for manipulation. However, the current "plain" output format has some decoration that impedes this, e.g.
$ trubka list topics -f plain
Topics (96)
───────────
● __consumer_offsets
● topic1
● topic2
● topic3
[...]
Total
─────
Topics: 96
Partitions: 180
Please change plain
, or add a different output format, that is just a simple plain-text list, with no decoration, headers, or footers, e.g.
$ trubka list topics -f plain
topic1
topic2
topic3
Describe the bug
Setting TRUBKA_PROTO_ROOT environment variable still gives an error about requiring the --proto-root
flag.
To Reproduce
$ echo $TRUBKA_PROTO_ROOT
/Users/jeff/dev/platypus
$ trubka consume proto --topic-filter wifi --proto-filter Blip --brokers localhost:9092 --kafka-version 2.2.0 -i
ERROR: Required flag --proto-root not provided
Expected behavior
If I provide this environment variable I shouldn't have to provide --proto-root
. According to the wiki:
It is possible to ask Trubka to read the cli flags from the system's environment variables. The flags must be in TRUBKA_FLAG_NAME format. For example the value of --proto-root parameter can be read from TRUBKA_PROTO_ROOT if it's provided.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.