You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm facing an issue where the Kafka key is JSON and I chose the ":" delimiter by default without thinking about it too much (the values are also JSON). This lead to keys and values being messed up when I produced back to Kafka through kafkacat.
Kafkacat file produced by consuming from topic with : delimiter (kafkacat -C -e -J -q -b localhost:9092 -t _schemas > schemas.log):
I could choose some magical character that probably has a high likelihood of never appearing in my data, but to be 100% foolproof I think kafkacat can add support to consume its own JSON format structure back into its Producer mode.
It would be much more robust and allow users to just be able to quickly save the JSON from the Consumer mode to a file and then read from it without needing to think about delimiters at all and possible collisions with actual characters within their data (either the key or the value).
Given that the JSON is well formed and organized it should be possible to expose an extra -J flag on the Producer side of things to support parsing the -J output produced in the Consumer mode.
Currently I'm facing an issue where the Kafka key is JSON and I chose the ":" delimiter by default without thinking about it too much (the values are also JSON). This lead to keys and values being messed up when I produced back to Kafka through kafkacat.
Kafkacat file produced by consuming from topic with
:
delimiter (kafkacat -C -e -J -q -b localhost:9092 -t _schemas > schemas.log
):I could choose some magical character that probably has a high likelihood of never appearing in my data, but to be 100% foolproof I think kafkacat can add support to consume its own JSON format structure back into its Producer mode.
It would be much more robust and allow users to just be able to quickly save the JSON from the Consumer mode to a file and then read from it without needing to think about delimiters at all and possible collisions with actual characters within their data (either the key or the value).
Given that the JSON is well formed and organized it should be possible to expose an extra
-J
flag on the Producer side of things to support parsing the-J
output produced in the Consumer mode.JSON mode for Consumer mode:
This way, as seen above, the producer would not need delimiters at all and just parse a well formed JSON object to extract the
key
andpayload
values.The text was updated successfully, but these errors were encountered: