Skip to content

Refine KotlinDetector.isKotlinType documentation for Kotlin 2.x lambdas #1147

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

Closed
antechrestos opened this issue May 29, 2024 · 2 comments
Closed

Comments

@antechrestos
Copy link

antechrestos commented May 29, 2024

Using the spring cloud stream with reactive used to work well by instanciating kotlin function as follows

@Configuration(proxyBeanMethods = false)
class MessageConfiguration {

   @Bean
   fun myMessageConsumer() = { rawMessagesFlux ->
            rawMessagesFlux
                .flatMap { // ... }
                .then()
   }

Moving to kotlin 2.0 fails as generated bean class returns false when passing it to KotlinDetector.isKotlinType. Hence starting of spring cloud stream module fails as KotlinFunctionWrapper is not put and the Configuration expects java Function, Consumer or Supplier ...

I also made a sample repo

@sdeleuze digged and found that maybe somehting can be done on your side, or at least be documented (see issue on spring framework repo ).

Thanks!

@olegz
Copy link
Contributor

olegz commented Jun 5, 2024

This has been addressed. Can you please re-test it with 4.1.3-SNAPSHOT?

@antechrestos
Copy link
Author

@olegz I can confirm that with 4.1.3-SNAPSHOT my application starts well 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants