Deserialization problem using AvroKafkaDeserializer

Viewed 14

I have to implement Kafka on a microservice, i have to implement the consumer exactly. the message that the consumer have to consume represent a class autogenerated with Avro from a schema, this schema is registered on apicurio registry. Now, the problem is: from the producer the messages are perfect, every field of the autogenerated class is valorized/not null, but when i receive the message i get a deserialization error and every field of the message is set to null. Below the consumer config:

props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServer);
        props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
        props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, AvroKafkaDeserializer.class.getName());
        props.put(SerdeConfig.REGISTRY_URL, pathRegistry);
        props.put(AvroKafkaSerdeConfig.USE_SPECIFIC_AVRO_READER, true);
        props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, autoOffsetReset);
        props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
        props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ErrorHandlingDeserializer.class);
        props.put(ErrorHandlingDeserializer.VALUE_DESERIALIZER_CLASS, AvroKafkaDeserializer.class);
        props.put(ErrorHandlingDeserializer.VALUE_FUNCTION, FailedAutogeneratedAvro.class); 
0 Answers
Related