Skip to content
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

feat: adapt Kafka bindings to v3 - take 2 #226

Merged
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions kafka/README.md
dalelane marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ This object MUST contain only the properties defined above.

##### Example

This example is valid for any Confluent compatible schema registry. Here we describe the implementation using the first 4 bytes in payload to store schema identifier.

```yaml
channels:
user-signedup:
Expand Down Expand Up @@ -122,16 +120,18 @@ This object MUST contain only the properties defined above.
```yaml
channels:
user-signedup:
subscribe:
bindings:
kafka:
groupId:
type: string
enum: ['myGroupId']
clientId:
type: string
enum: ['myClientId']
bindingVersion: '0.4.0'
operations:
userSignup:
action: receive
bindings:
kafka:
groupId:
type: string
enum: ['myGroupId']
lbroudoux marked this conversation as resolved.
Show resolved Hide resolved
clientId:
type: string
enum: ['myClientId']
lbroudoux marked this conversation as resolved.
Show resolved Hide resolved
bindingVersion: '0.4.0'
```


Expand All @@ -145,7 +145,7 @@ This object contains information about the message representation in Kafka.

Field Name | Type | Description
---|:---:|---
<a name="messageBindingObjectKey"></a>`key` | [Schema Object][schemaObject] \| [Reference Object](referenceObject) \| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html) | The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.4.0#referenceObject) way.
<a name="messageBindingObjectKey"></a>`key` | [Schema Object][schemaObject] \| [Reference Object](referenceObject) \| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html) | The message key.
<a name="messageBindingObjectSchemaIdLocation"></a>`schemaIdLocation` | string | If a Schema Registry is used when performing this operation, tells where the id of schema is stored (e.g. `header` or `payload`). | OPTIONAL | MUST NOT be specified if `schemaRegistryUrl` is not specified at the Server level
<a name="messageBindingObjectSchemaIdPayloadEncoding"></a>`schemaIdPayloadEncoding` | string | Number of bytes or vendor specific values when schema id is encoded in payload (e.g `confluent`/ `apicurio-legacy` / `apicurio-new`). | OPTIONAL | MUST NOT be specified if `schemaRegistryUrl` is not specified at the Server level
<a name="messageBindingObjectSchemaLookupStrategy"></a>`schemaLookupStrategy` | string | Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied. | OPTIONAL | MUST NOT be specified if `schemaRegistryUrl` is not specified at the Server level
Expand All @@ -158,25 +158,27 @@ This example is valid for any Confluent compatible schema registry. Here we desc
```yaml
channels:
test:
publish:
message:
address: test-topic
messages:
testMessage:
bindings:
kafka:
key:
type: string
enum: ['myKey']
schemaIdLocation: 'payload'
schemaIdPayloadEncoding: '4'
bindingVersion: '0.4.0'
schemaIdLocation: 'payload'
schemaIdPayloadEncoding: '4'
bindingVersion: '0.4.0'
```

This is another example that describes the use if Apicurio schema registry. We describe the `apicurio-new` way of serializing without details on how it's implemented. We reference a [specific lookup strategy](https://www.apicur.io/registry/docs/apicurio-registry/2.2.x/getting-started/assembly-using-kafka-client-serdes.html#registry-serdes-concepts-strategy_registry) that may be used to retrieve schema Id from registry during serialization.

```yaml
channels:
test:
publish:
message:
address: test-topic
messages:
testMessage:
bindings:
kafka:
key:
Expand All @@ -188,5 +190,5 @@ channels:
bindingVersion: '0.4.0'
```

[schemaObject]: https://www.asyncapi.com/docs/specifications/2.4.0/#schemaObject
[referenceObject]: https://www.asyncapi.com/docs/specifications/2.4.0/#referenceObject
[schemaObject]: https://www.asyncapi.com/docs/reference/specification/v3.0.0-next-major-spec.15#schemaObject
[referenceObject]: https://www.asyncapi.com/docs/reference/specification/v3.0.0-next-major-spec.15#referenceObject