kcat icon indicating copy to clipboard operation
kcat copied to clipboard

Setting message headers when piping in messages

Open kinghuang opened this issue 5 years ago • 1 comments

kafkacat can set message headers in producer mode with the -H <header=value> option. If I'm piping in messages to kafkacat to produce to a topic, is there a way that I can set the message headers as part of the input stream instead? Sort of like how a delimiter can be used to separate the message key and value?

I'm trying to send a trace ID with my messages, so a static header isn't sufficient. Here's a post about tracing with Kafka and Jaeger: Distributed Tracing with Apache Kafka and Jaeger.

kinghuang avatar Oct 21 '19 21:10 kinghuang

On further thought, I think what I really need is the ability to produce using JSON message envelopes.

kinghuang avatar Oct 22 '19 02:10 kinghuang