micronaut-kafka
micronaut-kafka copied to clipboard
Support the configuration of the schema registry url for Avro serializer/deserializer
According to the documentation we can specify different serializers/deserializers for producers/consumers in the configuration, e.g:
kafka:
producers:
xxx:
value:
serializer: org.apache.kafka.common.serialization.ByteArrayDeserializer
In order to use with Avro we would need to be able to configure the schema registry url.
You can configure anything you want in kafka below xxx
. Micronaut does not prevent that.
I think what was meant by the opener of this ticket is. If you use io.confluent.kafka.serializers.KafkaAvroSerializer
as the serializer configured for the producers, this serializer needs an instance of the type SchemaRegistryClient
in its constructor to function properly. And to create such an instance you will need an url.
However the problem here (to me) is that you are unable to tell micronaut how to instantiate the serializer.
kafka:
bootstrap:
servers: xxx:99092
consumers:
default:
specific.avro.reader: true
key.deserializer: org.apache.kafka.common.serialization.LongDeserializer
value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
schema.registry.url: http://registry-server-url:port
this works for me
@kalgecin seems like it could be a good contribution to the documentation?