Issue with deserializing to type in c# namespace different from avro namespace
Summary
When the AvroDeserializer gets a T that lives in a c# namespace different from the avro namespace it will not find the appropriate type.
Steps to reproduce
Create a consumer for a avro generated type that lives in a c# namespace different from the avro namespace.
ConsumerBuilder setup:
var builder = new AxualConsumerBuilder<string, TValue>(config)
.SetKeyDeserializer(Confluent.Kafka.Deserializers.Utf8)
.SetLogHandler((_, logMessage) => Log.Information("[KAFKA] Log: {@LogMessage}", logMessage))
.SetErrorHandler((_, error) => Log.Error("[KAFKA] Error: {Error}", error));
switch (_configuration.StreamConfiguration.Deserializer)
{
case KafkaDeserializer.Json:
builder.SetValueDeserializer(new JsonDeserializer<TValue>());
break;
case KafkaDeserializer.Avro:
builder.SetValueDeserializer(new AvroDeserializer<TValue>(_schemaRegistryClient).AsSyncOverAsync());
break;
default:
builder.SetValueDeserializer(new AvroDeserializer<TValue>(_schemaRegistryClient).AsSyncOverAsync());
break;
}
The c# type thats used to create the consumer (as you can see the c# namespace is different from avronamespace):
Exception when consuming:
What is the expected correct behavior?
I would except the AvroDeserializer to use the provided T to deserialize to, instead of looking for a c# type in a c# namespace similar to the avro namespace.
Edited by JBastiaan