From 50a817dc46c44d363f314301494a9a928d2d0426 Mon Sep 17 00:00:00 2001 From: Timon Back Date: Fri, 19 Apr 2024 22:14:10 +0200 Subject: [PATCH] chore: trying to reproduce GH-705 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Müller --- .../examples/kafka/consumers/TestConsumer.kt | 2 ++ .../src/test/resources/asyncapi.json | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/springwolf-examples/springwolf-kafka-example/src/main/kotlin/io/github/springwolf/examples/kafka/consumers/TestConsumer.kt b/springwolf-examples/springwolf-kafka-example/src/main/kotlin/io/github/springwolf/examples/kafka/consumers/TestConsumer.kt index ae106daa4..e14c2c929 100644 --- a/springwolf-examples/springwolf-kafka-example/src/main/kotlin/io/github/springwolf/examples/kafka/consumers/TestConsumer.kt +++ b/springwolf-examples/springwolf-kafka-example/src/main/kotlin/io/github/springwolf/examples/kafka/consumers/TestConsumer.kt @@ -3,6 +3,7 @@ package io.github.springwolf.examples.kafka.consumers import io.github.springwolf.core.asyncapi.annotations.AsyncListener import io.github.springwolf.core.asyncapi.annotations.AsyncOperation import io.github.springwolf.core.asyncapi.annotations.AsyncPublisher +import io.github.springwolf.plugins.kafka.asyncapi.annotations.KafkaAsyncOperationBinding import org.springframework.stereotype.Component import kotlinx.coroutines.* @@ -24,6 +25,7 @@ class AsyncConsumerProducer { payloadType = Output::class, ), ) + @KafkaAsyncOperationBinding suspend fun consumeAndProduce(input: Input) = coroutineScope { // suspend fun consumeAndProduce(@Payload input: Input) = coroutineScope { diff --git a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json index e8b470ef8..c611af36b 100644 --- a/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json +++ b/springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json @@ -1148,7 +1148,11 @@ }, "name": "io.github.springwolf.examples.kafka.consumers.Input", "title": "Input", - "bindings": { } + "bindings": { + "kafka": { + "bindingVersion": "0.5.0" + } + } }, "io.github.springwolf.examples.kafka.consumers.Output": { "headers": { @@ -1162,7 +1166,11 @@ }, "name": "io.github.springwolf.examples.kafka.consumers.Output", "title": "Output", - "bindings": { } + "bindings": { + "kafka": { + "bindingVersion": "0.5.0" + } + } }, "io.github.springwolf.examples.kafka.consumers.StringConsumer$StringEnvelope": { "headers": { @@ -1371,7 +1379,11 @@ }, "title": "INCOMING_REQUEST_receive", "description": "Inbound message.", - "bindings": { }, + "bindings": { + "kafka": { + "bindingVersion": "0.5.0" + } + }, "messages": [ { "$ref": "#/channels/INCOMING_REQUEST/messages/io.github.springwolf.examples.kafka.consumers.Input" @@ -1385,7 +1397,11 @@ }, "title": "OUTBOUND_RESPONSE_send", "description": "Outbound message.", - "bindings": { }, + "bindings": { + "kafka": { + "bindingVersion": "0.5.0" + } + }, "messages": [ { "$ref": "#/channels/OUTBOUND_RESPONSE/messages/io.github.springwolf.examples.kafka.consumers.Output"