From 77b14e70beea778204cbec39f9bc28fafb6cdea6 Mon Sep 17 00:00:00 2001 From: Laurent Broudoux Date: Fri, 24 Nov 2023 17:34:07 +0100 Subject: [PATCH 1/4] feat: adapt Kafka bindings to v3 - take 2 Signed-off-by: Laurent Broudoux --- kafka/README.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/kafka/README.md b/kafka/README.md index f26cd7bd..2e1531c5 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -122,16 +122,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'] + clientId: + type: string + enum: ['myClientId'] + bindingVersion: '0.4.0' ``` @@ -158,16 +160,17 @@ 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. @@ -175,8 +178,9 @@ This is another example that describes the use if Apicurio schema registry. We d ```yaml channels: test: - publish: - message: + address: test-topic + messages: + testMessage: bindings: kafka: key: @@ -188,5 +192,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 From a8024f004ca745fa02455af2dfb0d846d8d61b28 Mon Sep 17 00:00:00 2001 From: Dale Lane Date: Sun, 3 Dec 2023 18:41:13 +0000 Subject: [PATCH 2/4] fix: remove duplicated comment comment was copy/pasted from elsewhere in the file and isn't relevant for the example it's next to --- kafka/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/kafka/README.md b/kafka/README.md index 2e1531c5..3b51b9e2 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -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: From 031f96597443b781eae6aa781a9f2b9dc1329550 Mon Sep 17 00:00:00 2001 From: Laurent Broudoux Date: Mon, 4 Dec 2023 00:22:49 +0100 Subject: [PATCH 3/4] Fix indentations when moving Kafka bindings to v3 --- kafka/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kafka/README.md b/kafka/README.md index 3b51b9e2..0c1935d0 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -166,9 +166,9 @@ channels: 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. From ea459ae4374c4d7c4efe12f5ebd57e8b882b16b7 Mon Sep 17 00:00:00 2001 From: Laurent Broudoux Date: Mon, 4 Dec 2023 00:25:25 +0100 Subject: [PATCH 4/4] Fix indentation when moving Kafka bindings to v3 --- kafka/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kafka/README.md b/kafka/README.md index 0c1935d0..1a1c64e2 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -126,11 +126,11 @@ operations: bindings: kafka: groupId: - type: string - enum: ['myGroupId'] + type: string + enum: ['myGroupId'] clientId: - type: string - enum: ['myClientId'] + type: string + enum: ['myClientId'] bindingVersion: '0.4.0' ```