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!