I read the article with interest
[Multiple Event Types in the Same Kafka Topic - Revisited]
I am trying to the set up a topic to handle multiple types safely as suggested using schema references.
I was able to register the two schemas customer and product successfully and verified that the subject and schema are created.
shell>*curl -X GET http://localhost:8081/subjects/customer/versions/1*
{"subject":"customer","version":1,"id":1,"schema":"{\"type\":\"record\",\"name\":\"Customer\",\"namespace\":\"io.confluent.examples.avro\",\"fields\":[{\"name\":\"customer_id\",\"type\":\"int\"},{\"name\":\"customer_name\",\"type\":\"string\"},{\"name\":\"customer_email\",\"type\":\"string\"},{\"name\":\"customer_address\",\"type\":\"string\"}]}"}
shell>*curl -X GET http://localhost:8081/subjects/product/versions/1*
{"subject":"product","version":1,"id":2,"schema":"{\"type\":\"record\",\"name\":\"Product\",\"namespace\":\"io.confluent.examples.avro\",\"fields\":[{\"name\":\"product_id\",\"type\":\"int\"},{\"name\":\"product_name\",\"type\":\"string\"},{\"name\":\"product_price\",\"type\":\"double\"}]}"}
Then I created a new topic all_types into Control Center then when I try to assign a schema to the value of topic (all_types) using the above references, I am getting the following error.
Invalid schema [ { "name": "io.confluent.examples.avro.Customer", "subject": "customer", "version": 1 }, { "name": "io.confluent.examples.avro.Product", "subject": "product", "version": 1 } ] with refs [] of type AVRO
Any idea what I am doing wrong ?
I tried with confluent 5.5.3 (and 6,1,1). Both fail with similar error.
I am following the blog article closely, but I expect that a references list may be missing in the schema add. However I am not sure how to specify the reference list to the union in the topic schema.
Thanks,