Kotlin functions aren't detected as expected
Describe the bug I'm fairly certiain this is something I've done wrong, but I can't see where.
The docs suggest that this should work:
@SpringBootApplication
class FunctionalApp {
@Bean
fun kotlinFunction(): (String) -> String {
return { it.toUpperCase() }
}
}
However, the function isn't registered. Hitting /actuator/functions returns:
{
"functionRouter": {
"type": "FUNCTION",
"input-type": "object",
"output-type": "object"
}
}
If I move the registration into Java, it works as expected:
@Configuration
public class FunctionalConfig {
@Bean
public Function<String, String> uppercase() {
return input -> input.toUpperCase();
}
}
Now, hitting /actuator/functions returns:
{
"functionRouter": {
"type": "FUNCTION",
"input-type": "object",
"output-type": "object"
},
"uppercase": {
"type": "FUNCTION",
"input-type": "string",
"output-type": "string"
}
}
Sample
This issue was detected as part of a broader project, which has a number of issues associated with it. There's a reproducable example showing this example here - specifically note that kotlinFunction isn't registered.
I had the same problem:




It work:

I have the same issue as described here. I'm using spring cloud stream binder rabbit v4.0.2
This issue has been stale for over 60 days