schema-registry
schema-registry copied to clipboard
Kafka schema registration error
Hi All,
I have both KSQL and Kafka Connect plugged with Schema Registry. During deployment I am running 2 KSQL queries on the topic A. The first query creates a AVRO stream and the next converts it to a JSON stream. For the first query to run I need a schema in the schema registry and so I am registering one through curl. All the attributes in the schema are string with a default of null except on which is the column ID.
I am also using a Kafka Connect JDBC source Connector with the value serialiser as Avro with a poll interval of 60000ms with a custom query running in bulk mode with table whitelist as "Topic A".
When the jdbc source connects custom query returns some record, the connector status goes to failed and the log says error code 409 that is new schema is not compatible with the old one. It also logs the schema that it wants to register. Both are actually same. All attributes are string with a default null except ID as the ID is primary key.
But because of this error I cannot proceed. For now as a workaround for that subject I have made the compatibility to NONE.
But I think that is not the correct way.
Please let me know if my approach is not correct or it is a bug?
It would be useful to see the schema you are having registered.
Note: the JDBC source connector will register a schema on its own, but you can disable that in the config
Here is the schema
{ "type": "record", "name": "LabelExpiry", "aliases": ["LABEL_EXPIRY"], "fields": [ { "name": "ID", "type": ["null","string"],"default":null }, { "name": "SESSIONID", "type": ["null","string"],"default":null }, { "name": "LICENSEPLATE", "type": ["null","string"],"default":null }, { "name": "CARPARKNUMBER", "type": ["null","string"],"default":null }, { "name": "VEHICLETYPE", "type": ["null","string"],"default":null }, { "name": "SESSIONTYPE", "type": ["null","string"],"default":null }, { "name": "SESSIONSTART", "type": ["null","string"],"default":null }, { "name": "PARKINGENDTIME", "type": ["null","string"],"default":null }, { "name": "PARKINGSTARTTIME", "type": ["null","string"],"default":null }, { "name": "CLASS1APPLIED", "type": ["null","boolean"],"default":null }, { "name": "STATUS", "type": ["null","string"],"default":null } ] }
I will check the config for the source connector
Hi any update for thus issue ?