0

Hi I am developing an spring boot application with kafka and apicuro registry. I want to validate JSON messages which is being produced and consumed.

I have setup the below configuration in my application

spring.kafka.producer.bootstrap-servers: localhost:9092
spring.kafka.producer.key-serializer: org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer: 
io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaSerializer
spring.kafka.producer.properties.spring.json.add.type.headers=false
spring.kafka.producer.properties.apicurio.registry.url: http://localhost:8081/apis/registry/v2
spring.kafka.producer.properties.apicurio.registry.artifact-id: 
io.apicurio.registry.utils.serde.strategy.TopicIdStrategy
spring.kafka.producer.properties.apicurio.registry.artifact.version : "1"
spring.kafka.producer.properties.apicurio.registry.serdes.json-schema.validation-enabled: true

But when I go through the documentation it says i need to pass global ID in kafka message for deserialization to happen.

How do I define the global id and how do I go about it.

Also any reference to any sample code will be helpful

user1834664
  • 443
  • 3
  • 12
  • 22

0 Answers0