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

docs: update Kafka bindings to describe schema usage #55

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
38 changes: 30 additions & 8 deletions kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,36 @@ This document defines how to describe Kafka-specific information on AsyncAPI.

## Version

Current version is `0.1.0`.
Current version is `0.2.0`.


<a name="server"></a>

## Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object contains information about the server representation in Kafka.

##### Fixed Fields

Field Name | Type | Description | Applicability [default] | Constraints
---|:---:|:---:|:---:|---
`schemaRegistryUrl` | string (url) | API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used) | OPTIONAL | -
`schemaRegistryVendor` | string | Identifies the Kafka serdes library that should be used (e.g. `confluent`, `apicurio`, or `ibm`) | OPTIONAL | MUST NOT be specified if `schemaRegistryUrl` is not specified
dalelane marked this conversation as resolved.
Show resolved Hide resolved
`schemaRegistryAvailable` | boolean | Specifies if the Schema Registry identified in `schemaRegistryUrl` is available for use by consumers of the AsyncAPI spec | OPTIONAL [true] | MUST NOT be specified if `schemaRegistryUrl` is not specified
dalelane marked this conversation as resolved.
Show resolved Hide resolved
<a name="operationBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. | OPTIONAL [`latest`]

##### Example

```yaml
servers:
production:
bindings:
kafka:
schemaRegistryUrl: "https://my-schema-registry.com"
schemaRegistryVendor: "confluent"
schemaRegistryAvailable: false
bindingVersion: '0.2.0'
```


<a name="channel"></a>
Expand Down Expand Up @@ -55,7 +75,7 @@ channels:
clientId:
type: string
enum: ['myClientId']
bindingVersion: '0.1.0'
bindingVersion: '0.2.0'
```


Expand All @@ -67,10 +87,11 @@ This object contains information about the message representation in Kafka.

##### Fixed Fields

Field Name | Type | Description
---|:---:|---
<a name="messageBindingObjectKey"></a>`key` | [Schema Object][schemaObject] | The message key.
<a name="messageBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed.
Field Name | Type | Description | Applicability [default] | Constraints
---|:---:|:---:|:---:|---
<a name="messageBindingObjectKey"></a>`key` | [Schema Object][schemaObject] | The message key. | OPTIONAL | -
`schemaIdLocation` | `none` or `header` or `payload` | Location in the message of the ID that identifies the schema in a schema registry. | OPTIONAL [`none`] | -
<a name="messageBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. | OPTIONAL [`latest`] | -

This object MUST contain only the properties defined above.

Expand All @@ -85,7 +106,8 @@ channels:
key:
type: string
enum: ['myKey']
bindingVersion: '0.1.0'
schemaIdLocation: 'payload'
bindingVersion: '0.2.0'
```

[schemaObject]: https://www.asyncapi.com/docs/specifications/2.0.0/#schemaObject
14 changes: 14 additions & 0 deletions kafka/examples/traits/apicurio-v0.0.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: apicurio
summary: Message headers used by Apicurio serdes library
headers:
type: object
properties:
apicurio.value.globalId:
type: string
apicurio.value.version:
type: integer
apicurio.value.encoding:
type: string
enum:
- "BINARY"
- "JSON"
14 changes: 14 additions & 0 deletions kafka/examples/traits/ibm-v0.0.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: ibm-eventstreams
summary: Message headers used by IBM Event Streams serdes library
headers:
type: object
properties:
com.ibm.eventstreams.schemaregistry.schema.id:
type: string
com.ibm.eventstreams.schemaregistry.schema.version:
type: integer
com.ibm.eventstreams.schemaregistry.encoding:
type: string
enum:
- "BINARY"
- "JSON"