Skip to content

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

@antechrestos

Description

@antechrestos

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions