nfrankel
09/14/2019, 6:01 AMs1m0nw1
09/14/2019, 11:36 AMnfrankel
09/14/2019, 11:43 AM@SpringBootApplication
class SwissTrainApplication {
@Bean
fun demo(config: ServiceConfig): CommandLineRunner {
return CommandLineRunner {
with(Pipeline.create()) {
drawFrom(remoteService(config.url, config.token))
.withoutTimestamps()
.filter(PredicateEx { it.startsWith("{\"id\":\"") })
.map(FunctionEx<String, String> { it.removeSuffix(",") })
.mapUsingContext(ContextFactory.withCreateFn(createObjectMapper), toWrapper)
.drainTo(Sinks.logger())
Jet.newJetInstance().withCloseable().use {
it.newJob(this).join()
}
}
}
}
}
nfrankel
09/14/2019, 11:43 AMFunctionEx<String, String>
it compiles but fails at runtimenfrankel
09/14/2019, 11:44 AMjava.util
package)nfrankel
09/14/2019, 11:52 AMMike
09/14/2019, 1:09 PMnfrankel
09/14/2019, 1:56 PM