-
Notifications
You must be signed in to change notification settings - Fork 638
GH-1210: Add Kotlin suspend functions support #2460
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
Conversation
Fixes spring-projects#1210 Kotlin Coroutines are essentially `Future` wrapping. Therefore, it is natural to have `suspend` support on `@RabbitListener` methods as we do now for `CompletableFuture` and `Mono` * Introduce some utilities since we cannot reuse existing from Spring Messaging: they are there about Kotlin Coroutines only for reactive handlers * Some code clean up in the `RabbitListenerAnnotationBeanPostProcessor` for the latest Java * Add optional dep for `kotlinx-coroutines-reactor` and document the feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work; thanks!
@@ -56,6 +56,7 @@ ext { | |||
jaywayJsonPathVersion = '2.7.0' | |||
junit4Version = '4.13.2' | |||
junitJupiterVersion = '5.9.2' | |||
kotlinCoroutinesVersion = '1.6.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this version? I see SI is using 1.7.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is already to realign with SF 6.1
. Not sure if current AMQP version should make a jump to not be compatible with SF 6.0.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
endpoint.setQueueNames(resolvedQueues.stream() | ||
.map(o -> (String) o) | ||
.collect(Collectors.toList()).toArray(new String[0])); | ||
endpoint.setQueueNames(resolvedQueues.stream().map(o -> (String) o).toArray(String[]::new)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convention is new line per .
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but looks a bit awkward as a method argument.
I can bring it back if you wish or introduce a local variable.
Hi there, quick question, will this feature be supported in version |
@jhoanmanuelms We can take a look, but can provide no guarantee - it depends on how cleanly the code back ports; there are many changes in 3.0.x that might cause too many conflicts. Please open a new issue so it's not forgotten. |
…projects#2460) * spring-projectsGH-1210: Add Kotlin suspend functions support Fixes spring-projects#1210 Kotlin Coroutines are essentially `Future` wrapping. Therefore, it is natural to have `suspend` support on `@RabbitListener` methods as we do now for `CompletableFuture` and `Mono` * Introduce some utilities since we cannot reuse existing from Spring Messaging: they are there about Kotlin Coroutines only for reactive handlers * Some code clean up in the `RabbitListenerAnnotationBeanPostProcessor` for the latest Java * Add optional dep for `kotlinx-coroutines-reactor` and document the feature * * Remove unused import
…projects#2460) * spring-projectsGH-1210: Add Kotlin suspend functions support Fixes spring-projects#1210 Kotlin Coroutines are essentially `Future` wrapping. Therefore, it is natural to have `suspend` support on `@RabbitListener` methods as we do now for `CompletableFuture` and `Mono` * Introduce some utilities since we cannot reuse existing from Spring Messaging: they are there about Kotlin Coroutines only for reactive handlers * Some code clean up in the `RabbitListenerAnnotationBeanPostProcessor` for the latest Java * Add optional dep for `kotlinx-coroutines-reactor` and document the feature * * Remove unused import
@jhoanmanuelms Turns out the back port was not too challenging; however, I had to pull in an older version of kotlin coroutines because 2.4.x is used with Boot 2.7.x and the versions need to be aligned. |
Fixes #1210
Kotlin Coroutines are essentially
Future
wrapping. Therefore, it is natural to havesuspend
support on@RabbitListener
methods as we do now forCompletableFuture
andMono
RabbitListenerAnnotationBeanPostProcessor
for the latest Javakotlinx-coroutines-reactor
and document the feature