spring-cloud / spring-cloud-schema-registry

A schema registry implementation for Spring Cloud Stream
47 stars 28 forks source link

Resolving writer schema when subject name contains hyphens #44

Open arekgorecki opened 4 years ago

arekgorecki commented 4 years ago

I'm trying to read avro message from kafka where subject name is user-intake. I publish message with header: "contentType": "application/vnd.user-intake-value.v1+avro" (TopicNameStrategy) , but I'm getting org.apache.avro.AvroRuntimeException: Malformed data. Length is negative: -41 when reading it.

I have went through the code and it seems to me that the problem is caused by schema regex which doesn't allow any hyphens - link.

Am I doing something wrong here or is it the library which simply does not allow certain characters in the name of schema?

PS: I can provide additional information if the one above is not sufficient.