-
Notifications
You must be signed in to change notification settings - Fork 102
How to get the schema subject from a message? #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have the same need. In our case, we're processing events with multiple event types sent on a single kafka topic. In other words, we're receiving events on a given topic that were encoded with varying schemas. When processing these events, we'd like to determine the schema As @Matan-Yadaev-Forter indicated, it's possible to get the id of the schema used to decode the incoming event message. It'd be nice if the library exposed a convenience method for retrieving the schema subject: const schemaSubject = getSchemaSubjectFromMessage(buffer); |
Looking at the ![]() |
@joyrexus You can get the schema this way, but I didn't find how I can extract the subject out of it. |
@Matan-Yadaev-Forter You should be able to use the registry API directly to get the schema subject for each version: ![]() |
I have a service that publishes messages to a queue (not Kafka), and these messages are encoded using a schema from the Schema Registry.
On the consumer side, I want to validate that the message was encoded using a schema subject that the consumer knows and supports.
Extracting the schema ID is straightforward (bytes 1-4 of the message), but I couldn't find an API that allows retrieving the subject associated with a given schema ID.
Is there a recommended way to achieve this? Any ideas or best practices?
Thanks!
The text was updated successfully, but these errors were encountered: