-
Notifications
You must be signed in to change notification settings - Fork 81
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
KafkaTrigger (.NET) does not work with Avro schema that has the has an array of records #455
Comments
I am using "dotnet" for the function. |
I have just tried recreating the setup in a Console app using |
@jainharsh98 are there any plans to upgrade the library to use Confluent.Kafka v2.2.0? I have found a work-around for my issue which is to use the Chr.Avro.Confluent library (https://github.com/ch-robinson/dotnet-avro) for the deserialization, but this uses Confluent.Kafka 2.2.0 and as such clashes with the azure-functions-kafka-extension using Confluent.Kafka 1.9.0. Using both these libraries at the same time forces azure-functions-kafka-extension to use 2.2.0 which results in the following error on startup:
Of course I would ideally like to just use azure-functions-kafka-extension for triggering the function and doing the deserialization, but an acceptable workaround for me would be to use azure-functions-kafka-extension to trigger the function when new messages arrive in Kafka and then use Chr.Avro.Confluent to deserialize them from a byte[] to the .NET classes I have. |
@michny We have library upgrade as a part of our roadmap. Since this is a major version change any breaking changes need to be taken care of before the release. We currently do not have any ETA on this. |
I have an Avro schema that looks like this:
If I try to use the Avro schema in my KafkaTrigger using either "SchemaRegistryUrl" or "AvroSchema" properties and a "events" type as
KafkaEventData<GenericRecord>[]
I get the following error:Confluent.Kafka: Local: Value deserialization error. System.Private.CoreLib: Unable to cast object of type 'System.Object[]' to type 'Avro.Generic.GenericRecord'.
Changing the events type to
KafkaEventData<GenericRecord[]>[]
results in the same error.Is it not possible to deserialize the messages using Avro with an array type? I have to use SchemaRegistryUrl as the Avro schema is managed by another team (the providers) so I can't hardcode the schema as a C# class.
The text was updated successfully, but these errors were encountered: