-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does xk6-kafka support avro union type? #220
Comments
Hey @luciowu, I use srclient for management of schema and schema registry, which internally uses go-avro. As far as I've looked, go-avro supports union types. export default function () {
for (let index = 0; index < 2; index++) {
let messages = [
{
value: schemaRegistry.serialize({
data: {
name: { string: "xk6-kafka" }, // This is how the data should be passed to union type
},
schema: { schema: valueSchema },
schemaType: SCHEMA_TYPE_AVRO,
}),
},
];
writer.produce({ messages: messages });
}
} |
Yep. you're right. I just figure out the difference in the go-avro and other programming language libraries. |
Hello,
I am trying to use xk6-kafka with Avro format.
It is fine for me to use this example https://github.com/mostafa/xk6-kafka/blob/main/scripts/test_avro_no_schema_registry.js
But if I did a small modification on the code with avro union type (because in our case, we use union type) as the following
it will report error
executor=constant-vus scenario=sasl_auth source=stacktrace ERRO[0005] GoError: Failed to encode data, OriginalError: %!w(*errors.errorString=&{cannot decode textual record "dev.mostafa.xk6.kafka.Value": cannot decode textual union: expected: '{'; actual: '"' for key: "name"})
Not sure is this issue related to my code or this plugin. Could you help on it?
Thanks.
The text was updated successfully, but these errors were encountered: