-
-
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
docs: update Kafka bindings to describe schema usage #55
Conversation
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
I've put an illustration of how this could be used in https://gist.github.com/dalelane/3931c17b14c51fa4a1cf25496237d188 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dalelane for great work. In my opinion, there's still the need for useRegistry
flag dissociated from servers.
Moving the message traits definitions into an examples folder to make it clear that they are not part of the spec or bindings. Contributes to: asyncapi#40 Signed-off-by: Dale Lane <[email protected]>
Signed-off-by: Dale Lane <[email protected]>
There is some debate about the best place to host and manage these, and as these aren't directly required for this PR I'd like to move them out so that they're not a blocker to this being merged. Contributes to: asyncapi#40 Signed-off-by: Dale Lane <[email protected]>
It's easier to add fields in a future PR than to remove them, so I'm erring on the cautious side for now and removing this (as I think there is some duplication and potential for conflict with useSchemaRegistry) Contributes to: asyncapi#40 Signed-off-by: Dale Lane <[email protected]>
Also sorted the list alphabetically to avoid indicating any other significance to the ordering. Signed-off-by: Dale Lane <[email protected]>
where are we with this PR? looks good to me |
it is a good start ! some users (like me) needs to provide extra informations about topics naming strategy like this (confluent specific)
So maybe it will be nice to allow bindings extension by A Slack community discussion is started here : https://asyncapi.slack.com/archives/C34F2JV0U/p1618495734389300 |
@M3lkior where does it say extensions in bindings are not allowed? I mean that additional properties are not allowed? when you do
all is good, but for now of course because of the fact that bindings do not have schemas |
i try to set bindings with |
@M3lkior you sure? I recently updated playground with latest HTML where you contributed bindings info rendering and I can see the extension is rendered 👇🏼 If spec doesn't say extensions are not allowed, then we are good. Bindings object can be extended and protocol-specific binding objects too. There is some work on schemas started #60 Can I suggest you create a separate issue in the spec repo to clarify if we should not have explicitly described in the spec that specific bindings must always be extendable? Instead of having it as a decision per binding? |
yes sorry : (by the way, there is a rendering issue with too long text in the declaration) |
@M3lkior no worries. Fix for the bug asyncapi/html-template#183 |
@derberg Sorry, been super busy recently and this one got away from me. I've changed the state to Draft to reflect that there are a few bits of feedback that I need to consider and reflect in the PR:
|
Hi there! Had a review this morning and I'm struggling with the From the binding README, definition of Also the default value for I think we should solve this ambiguity and I see 2 options at the moment:
From my perspective, I prefer option 1. as I find it more easy to use for non-expert of SerDes library and more straightforward for most common cases. That way, you may have something like: channels:
user-signedup:
publish:
bindings:
kafka:
groupId:
type: string
enum: ['myGroupId']
clientId:
type: string
enum: ['myClientId']
bindingVersion: '0.2.0' and this is telling that this operation/channel is not using any registry. Then we can enable registry usage explicitly: channels:
user-signedup:
publish:
bindings:
kafka:
groupId:
type: string
enum: ['myGroupId']
clientId:
type: string
enum: ['myClientId']
useSchemaRegistry: true
bindingVersion: '0.2.0' and this mean that a Schema registry is used and consumer will have to pick the SerDes implementation corresponding to registry vendor. The Schema ID Location will thus be the channels:
user-signedup:
publish:
bindings:
kafka:
groupId:
type: string
enum: ['myGroupId']
clientId:
type: string
enum: ['myClientId']
useSchemaRegistry: true
bindingVersion: '0.2.0'
message:
bindings:
kafka:
schemaIdLocation: 'header'
bindingVersion: '0.2.0' and this is necessary only is we're not sticking with most common usage. What do you think? |
@lbroudoux I think there are two use cases this is looking to handle:
For use case 1 - Missing:
For use case 2 - to deserialize from the payload without using a SERDES library you need to know:
I think this means that there are two sets of properties - with overlap but no conflict. You could combine the two sets to describe both use cases on the same spec without any clashes (though for code generation purposes I guess you'd generate using SERDES if all required SERDES properties are described). I think the only change to the constraint is that Does that clear up the ambiguity by separating properties into the two different concerns? |
Thanks @nictownsend : this makes things clearer. However, I'd thought that props.putIfAbsent(SerdeConfig.ENABLE_HEADERS, "true") Is it correct? +1 for the missing lookup strategies! |
Good point, yes for Apicurio case - So do we then have the following properties:
Only query is whether it can be assumed that every vendor uses a magic byte when writing schema to payload. If not, then |
This pull request has been automatically marked as stale because it has not had recent activity 😴 |
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: #40
Contributes to: #41
Signed-off-by: Dale Lane [email protected]