New to Kotlin. I am using Apache Camel and have created a route using the process
transformer like so:
from("snmp:blahblah...")
.routeId("CamelSnmpRoute")
...
.process { <<< Here
logger.debug("Log stuff")
}
Error:
Overload resolution ambiguity. All these functions match.
* public final fun process(processor: (() -> Processor!)!): RouteDefinition! defined in org.apache.camel.model.RouteDefinition
* public final fun process(processor: ((exchange: Exchange!) -> Unit)!): RouteDefinition! defined in org.apache.camel.model.RouteDefinition
I have tried doing .process { () ->
but it doesn't like that, saying it is expecting a name between the brackets. In the mean time, I can get past the erroring using .process { exchange ->
and not using the exchange
var, or creating a logProcessor var and passing it in:
.process(logProcessor)
}
private var logProcessor: Processor = Processor {
logger.debug("Logging stuff")
}
Can someone tell me how to inline this var so as to not create the ambiguity, or a redundant var?