Support binary input mode for producing from stdin #133
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suppose we have a program that produces some kind of binary output. We would like to be able to pipe the output of this program to kafkacat so that the binary output is created as a single message to kafka. However when kafkacat reads from stdin it assumes the input is delimited, and thus may split the input into multiple messages no matter what delimiter we choose. We can work around this by saving the output of the program to a file first and have kafkacat read from the file, but this requires an extra roundtrip to a file on disk. To avoid this extra step I'd like to propose a new binary mode for reading from stdin that treats the entire input as one message. Using this mode we can pipe the output directly to kafka using
create-binary-output | kafkacat -B
. Hopefully the idea seems sound to you. If you decide to incorporate something like this we can change the name of the switch, its description, etc. to your liking.