Expected Behavior
With SpringBoot, Kotlin, PollerBehaviorAutoscaling, worker threads should inherit the context class loader of the thread that started the WorkerFactory.
Actual Behavior
When PollerBehaviorAutoscaling is enabled, worker threads are assigned jdk.internal.loader.ClassLoaders$AppClassLoader as their context class loader instead of Spring Boot's LaunchedClassLoader.
so even though io.temporal:temporal-kotlin was already on the classpath. The error was thrown when calling Async.procedure with Kotlin method references inside a workflow.
error being
java.lang.IllegalStateException: Kotlin method reference is used with async.
For Temporal to correctly support async invocation kotlin method references,
add io.temporal:temporal-kotlin to classpath
Steps to Reproduce the Problem
- user has kindly provided a repro here https://drive.google.com/file/d/1_-mEnJerLUWPDK97vQScENeqIfmVrHnr/view?usp=sharing
Specifications