'Schema not found exception in kafka

I got a schema not found exception after I am setting the cleanup policy to schema registry.

The error is (stack_trace):

org.apache.kafka.common.errors.SerializationException: Error retrieving Avro schema for id 425
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema not found; error code: 40403
at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:209)

everything is working before updating and restart the schema registry.



Solution 1:[1]

everything is working before updating and restart the schema registry

The Registry maintains an internal HashMap. If you restart it, the map must be rebuilt.

If the _schemas topic that is used to rebuild the topic is misconfigured to not compact data, then schemas will be deleted.

Meanwhile, any schema IDs that were previously produced into the other topics your apps are using are now invalid.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 OneCricketeer