I just upgraded to 1.5 and am running into this problem. Given this code:
class AtMostNExceptionHandling(
private val maximumNumberOfExceptionsToHandleAfterLastSuccess: Int,
workBlock: Runnable,
exceptionHandlingBlock: Consumer<Exception>,
successfulAgainHandler: () -> Unit = {}
) {
...
}
val workBlock = outgoingKafkaQueueProcessor::processAllQueuedMessages
val exceptionHandlerBlock = { exception: Exception ->
...
}
val atMostNExceptionHandling = AtMostNExceptionHandling(
3,
workBlock, // Line 21
exceptionHandlerBlock,
{
...
}
)
I get the following exception at runtime:
Exception in thread "Thread-11" java.lang.NoSuchMethodError:
kotlin.reflect.KFunction.invoke()Ljava/lang/Object;
at com.maqqie.planning.core.kafka_outgoing.internal.queue_processor.
OutgoingKafkaQueueWorkProcessingAvailabilityQueueTrigger.run$lambda-0
(OutgoingKafkaQueueWorkProcessingAvailabilityQueueTrigger.kt:21)
When I inline workBlock
I do not get an exception:
val atMostNExceptionHandling = AtMostNExceptionHandling(
3,
outgoingKafkaQueueProcessor::processAllQueuedMessages,
exceptionHandlerBlock,
{
...
}
)