Using JR to pipe data to kcat

If you don’t want to use the JR embedded Kafka support, you can use the wonderful kcat CLI tool together with JR.

JR supports kcat out of the box. Using the --kcat flag the standard output will be formatted with K,V on a single line: --kcat in fact it’s only a shorthand equivalent for --output stdout --outputTemplate '{{.K}},{{.V}}' --oneline

jr run -k '{{randoms "ONE|TWO|THREE"}}' -f 1s -d 5s net_device --kcat | kcat -F kafka/config.properties -K , -P -t test