spring-cloud/spring-cloud-function

Refine KotlinDetector.isKotlinType documentation for Kotlin 2.x lambdas

antechrestos opened this issue · 2 comments

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!

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

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