I'm trying to produce an event on Kafka using Spring Cloud and Kafka Avro Serializer.
In my application.yml I have the configuration below, but when the Serializer tries to generate the message, It generates as bytes, because the object passed to getScheme method in KafkaSerializer is a byte array and it isn't a GenericRecord. I think that I need a specific MessageConverter in Spring Cloud, but I don't find any.
cloud:
stream:
kafka:
binder:
brokers:
- 'localhost:9092'
useNativeDecoding: true
bindings:
Ptr-output:
producer:
configuration:
schema.registry.url: 'http://localhost:8081'
key.serializer: org.apache.kafka.common.serialization.StringSerializer
value.serializer: com.abc.message.ptr.KafkaSerializer
schemaRegistryClient:
endpoint: 'http://localhost:8081'
bindings:
Ptr-output:
contentType: application/*+avro
destination: Ptr
schema:
avro:
schema-locations: 'classpath:avro/Ptr.avsc'
dynamic-schema-generation-enabled: false
How can I do? How can I solve it?