confluent-kafka-javascript icon indicating copy to clipboard operation
confluent-kafka-javascript copied to clipboard

Schema Registry: getSchemaById method missing

Open nhr-one opened this issue 11 months ago • 1 comments

Hi all,

We are currently migrating from using @kafkajs/confluent-schema-registry to @confluentinc/schemaregistry, but one element of the deserialization process is causing us an issue with migrating.

For @kafkajs/confluent-schema-registry, the deserialization method only requires the buffer to be passed in. Under the hood, it decodes the registryId from the payload, and uses the getSchemaById method to complete the deserialization of the payload. You can see the code pointer here.

In @confluentinc/schemaregistry, deserialization requires both the topic and the buffer to be passed in. It seems like this is because, rather than getSchemaById, this library uses getBySubjectAndId. The code pointer for that is here.

Unfortunately in our specific use case, it's going to be a challenge to thread through the topic to the point where we do our message deserialization - would it be possible to change this interface so that it only requires the buffer instead? Or is there a reason we are missing as to why getBySubjectAndId is required in this case?

Thanks in advance!

nhr-one avatar Jan 29 '25 05:01 nhr-one

Can you try passing an empty string for the subject?

rayokota avatar Jan 30 '25 17:01 rayokota