-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Possibility to produce avro encoded message to schema regustry powered topic #181
Comments
Hello @birdayz @fabiojmendes Unfortunately doesn't work for me.
{
"type": "record",
"name": "CreateUserProfileWallet",
"namespace": "Contracts.WalletManager.Commands",
"fields": [
{
"name": "CurrencyCode",
"type": "string"
}
]
}
{
"CurrencyCode": "EUR"
}
kaf --version
kaf version 0.1.45 (2abe93c6fcda5d87aab2f23b6f993f20806304da)
cat my.json | kaf produce --avro-schema-id 25 my_topic
Failed to encode avro
%!(EXTRA *errors.errorString=cannot decode textual record "Contracts.WalletManager.Commands.CreateUserProfileWallet": short buffer) |
Hi @eshepelyuk, kaf expects one record per line by default and it looks like your input spans a few lines. That's why you're getting the parse error from avro. You can change this behaviour by passing a
Or you can reformat your json to fit in one line, which has the benefit of allowing you to pass many inputs in a single file. |
Thanks @fabiojmendes Also, what about making schema id flag optional as I asked in PR ? |
I'm not sure about making it optional. Since plain text, json and protobuf are also supported, the flag is what tells the kaf that it should encode as avro. |
I didnt mean to remove flag itself (but it also can be removed if you check schema registry before each publish, to detect format). I meant rather removal of mandatory schema id passing, and either support The entire goal of this optimization to avoid going to schema registry to check actual id and make kaf doing it for a user. |
@fabiojmendes @birdayz created #195 as followup. |
Hello
Some tools allow to produce avro encoded messges to topic using schema from schema registry using JSON file as input message.
For example this https://github.com/tchiotludo/akhq
The text was updated successfully, but these errors were encountered: