Mikhail Dubrovin
Mikhail Dubrovin

Reputation: 88

Subject does not have subject-level compatibility configured

We use Kafka, Kafka connect and Schema-registry in our stack. Version is 2.8.1(Confluent 6.2.1). We use Kafka connect's configs(key.converter and value.converter) with value: io.confluent.connect.avro.AvroConverter.

It registers a new schema for topics automatically. But there's an issue, AvroConverter doesn't specify subject-level compatibility for a new schema and the error appears when we are trying to get config for the schema via REST API /config: Subject 'schema-value' does not have subject-level compatibility configured

If we specify the request parameter defaultToGlobal then global compatibility is returned. But it doesn't work for us because we cannot specify it in the request. We are using 3rd party UI: AKHQ.

How can I specify subject-level compatibility when registering a new schema via AvroConverter?

Upvotes: 2

Views: 2779

Answers (3)

oopsmails
oopsmails

Reputation: 301

As of 2021-10-26, I used akhq 0.18.0 jar and confluent-6.2.0, the schema registry in akhq is working fine.

Note: I also used confluent-6.2.1, seeing exactly the same error. So, you may want to switch back to 6.2.0 to give a try.

P.S: using all only for my local dev env, VirtualBox, Ubuntu.

Upvotes: 1

Mikhail Dubrovin
Mikhail Dubrovin

Reputation: 88

@OneCricketeer is correct. There is no possibility to specify subject-level compatibility in AvroConverter unfortunately.

I see only two solutions:

  1. Override AvroConverter to add property and functionality to send an additional request to API /config/{subject} after registering the schema.
  2. Contribute to AKHQ to support defaultToGlobal parameter. But in this case, we also need to backport schema-registry RestClient. Github issue

The second solution is more preferable till the user would specify the compatibility level in the settings of the converter. Without this setting in the native AvroConverter, we have to use the custom converter for every client who writes a schema. And it makes a lot of effort.

For me, it looks strange why the client cannot set up the compatibility at the moment of registering the schema and has to use a different request for it.

Upvotes: 0

OneCricketeer
OneCricketeer

Reputation: 191973

Last I checked, the only properties that can be provided to any of the Avro serializer configs that affect the Registry HTTP client are the url, whether to auto-register, and whether to use the latest schema version.

There's no property (or even method call) that sets either the subject level or global config during schema registration

You're welcome to check out the source code to verify this

But it doesn't work for us because we cannot specify it in the request. We are using 3rd party UI: AKHQ

Doesn't sound like a Connect problem. Create a PR for AKHQ project to fix the request

Upvotes: 1

Related Questions