kcat icon indicating copy to clipboard operation
kcat copied to clipboard

Newline appended to message when producing from a file

Open lkasser1 opened this issue 3 years ago • 2 comments

Suppose I have a file containing the string 1 named 1.txt. If I run

kafkacat -F /kafkacat.properties -P -t topic 1.txt

the message that appears on the topic will be 1.txt\n, despite no newline being in my file. Note that this is not the case if I use the -l flag

The impact of this bug is that I can't safely write binary data to a topic from a file. Also, if messages are copied multiple times (as in the case of a Dead Letter Queue), the number of newlines can grow quite large.

lkasser1 avatar Feb 22 '21 23:02 lkasser1

What version of kafkacat?

edenhill avatar Feb 23 '21 07:02 edenhill

1.4.0. I'll try it with the 1.6.0 version

lkasser1 avatar Feb 24 '21 20:02 lkasser1