diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/async-returns.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/async-returns.adoc index 78f3818d4e..451a93dadb 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/async-returns.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/async-returns.adoc @@ -2,7 +2,7 @@ = Asynchronous `@KafkaListener` Return Types `@KafkaListener` (and `@KafkaHandler`) methods can be specified with asynchronous return types, letting the reply be sent asynchronously. -return types include `CompletableFuture`, `Mono` and Kotlin `suspend` functions +return types include `CompletableFuture`, `Mono` and Kotlin `suspend` functions. [source, java] ---- diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc index bb43911f48..77198a4bc9 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc @@ -17,5 +17,5 @@ See xref:kafka/transactions.adoc#transaction-id-suffix-fixed[Fixed TransactionId [[x32-async-return]] === Async @KafkaListener Return -`@KafkaListener` (and `@KafkaHandler`) methods can now return asynchronous return types `CompletableFuture` and `Mono`. +`@KafkaListener` (and `@KafkaHandler`) methods can now return asynchronous return types include `CompletableFuture`, `Mono` and Kotlin `suspend` functions. See xref:kafka/receiving-messages/async-returns.adoc[Async Returns] for more information. \ No newline at end of file diff --git a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/AsyncRepliesAware.java b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/AsyncRepliesAware.java index 43ea7fda3c..a177c074fd 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/AsyncRepliesAware.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/AsyncRepliesAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 the original author or authors. + * Copyright 2023-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,15 +17,16 @@ package org.springframework.kafka.listener.adapter; /** - * Auto-detect {@link HandlerAdapter} return type. + * Message handler adapter implementing this interface can detect {@link HandlerAdapter} async return types. * * @author Wang zhiyang + * * @since 3.2 */ public interface AsyncRepliesAware { /** - * Return true if this listener is request/reply and the replies are async. + * Return true if the {@link HandlerAdapter} return type is async. * @return true for async replies. * @since 3.2 */ diff --git a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/ContinuationHandlerMethodArgumentResolver.java b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/ContinuationHandlerMethodArgumentResolver.java index d870ea5264..f475f72a58 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/ContinuationHandlerMethodArgumentResolver.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/ContinuationHandlerMethodArgumentResolver.java @@ -30,7 +30,9 @@ * but for regular {@link HandlerMethodArgumentResolver} contract. * * @author Wang Zhiyang + * * @since 3.2 + * * @see org.springframework.messaging.handler.annotation.reactive.ContinuationHandlerMethodArgumentResolver */ public class ContinuationHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { diff --git a/spring-kafka/src/test/kotlin/org/springframework/kafka/listener/EnableKafkaKotlinCoroutinesTests.kt b/spring-kafka/src/test/kotlin/org/springframework/kafka/listener/EnableKafkaKotlinCoroutinesTests.kt index 573592c559..aaf1f079d3 100644 --- a/spring-kafka/src/test/kotlin/org/springframework/kafka/listener/EnableKafkaKotlinCoroutinesTests.kt +++ b/spring-kafka/src/test/kotlin/org/springframework/kafka/listener/EnableKafkaKotlinCoroutinesTests.kt @@ -56,7 +56,7 @@ import java.util.concurrent.TimeUnit @SpringJUnitConfig @DirtiesContext @EmbeddedKafka(topics = ["kotlinAsyncTestTopic1", "kotlinAsyncTestTopic2", - "kotlinAsyncBatchTestTopic1", "kotlinAsyncBatchTestTopic2", "kotlinReplyTopic1"]) + "kotlinAsyncBatchTestTopic1", "kotlinAsyncBatchTestTopic2", "kotlinReplyTopic1"], partitions = 1) class EnableKafkaKotlinCoroutinesTests { @Autowired