-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Specify how Avro schema ID is serialized on Kafka #41
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
I had a go at illustrating what this would look like. It got a bit long, so instead of putting it in a super-long comment here, I've put it in a stand-alone gist at https://gist.github.com/dalelane/3931c17b14c51fa4a1cf25496237d188 |
I believe - binary/json can be inferred from the message binding content type? application/json or application/octet-stream? |
@nictownsend That's a great idea - much simpler! I've updated the gist with that. |
@lbroudoux I've updated the gist to reflect your remaining comments in Slack. It's slightly different to what you suggested (I put |
https://gist.github.com/dalelane/3931c17b14c51fa4a1cf25496237d188#how-this-could-be-described-in-asyncapi-3 - I don't think Also, I think I agree with @lbroudoux over |
Adding enough information about how schemas are being used in Kafka messages to enable an application that consumes messages serialized using schemas to be implemented purely from an AsyncAPI spec. Also introduces two new common, reusable definitions that can be used as message traits, to make it easier to quickly specify headers used to capture schema details. Contributes to: asyncapi#40 Contributes to: asyncapi#41 Signed-off-by: Dale Lane <[email protected]>
Hi @dalelane and @nictownsend, I agree with @nictownsend with the Also, to me it seems that the To me What do you think? I'll also have a review on the PR #55 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
Hi folks, this one is getting stale, do we plan to push it forward? |
hi @derberg yeah, sorry - my to-do list has gotten a bit out of control recently so I've not had time to put into this one for a while If someone wants to take this and run with it, I certainly won't complain. But if no-one does, I really do want to come back to this and finish it. |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
Hey folks, |
Sorry about that - I've been a bit distracted the last couple months between new job, holiday, etc. Let me pick this up again this week, and I'll re-open when I have something worth sharing. |
Can anyone please help why I am not able to run and execute the generator for the remote using I have seen some examples where they are providing the schema registry url under Url-->Binding Here is how my asyncapi.yaml looks like asyncapi: 2.4.0 |
@tanujazz3 Hello! Your question doesn't look like it is related to this closed issue - would you mind opening a new issue so this can be investigated, please? I think https://github.com/asyncapi/java-spring-template/issues would be the best place to do that. And please can you include an example of the output you get when you run the command. |
Reason/Context
AsyncAPI allows to reference Avro schema used for serializing / deserializing messages on a topic and parser has a sample on how to express that with a schema being already into a registry. Nice !
When it comes to serializing Avro data to a Kafka topic, you usually have 2 options :
As you have guessed, using one or the other of these options has impact on the consumers ! But as of today, consumer has no mean to know which one of the serialization mode is used.
Moreover, it appears that different SerDes libraries (Confluent, Apicurio and IBM as examples) have different way of serializing the Schema ID. Confluent is using first byte of payload to encode the schema ID whereas Apicurio and IBM SerDes are also able to put the ID into headers.
After exposing this issue on the AsyncAPI Slack, there's also concerns on how to retrieve Schema Registry endpoint URL. As we already have Server information with specific bindings info into AsyncAPI, it can be considered as legit - in the case a Schema Registry is needed to deserialize message - to also allow specification of the Schema Registry URL associated to Server.
Description
I propose to add a new Kafka specific binding attribute like at the
Channel
level to specify how the Schema ID is encoded. We could call itschemaIDLocation
with possible values beingheader
orpayload
. If binding attribute is missing then it simply means that Schema info is not provided. Depending on location value you may switch to different SerDes implementation for consumer generation or configurationI also propose to add a new Kafka specific binding attribute at the
Server
level to specify the Schema Registry URL. Simply name itschemaRegistryUrl
.The text was updated successfully, but these errors were encountered: