2. Safe Harbor Statement
The following is intended to outline the general direction of Pivotal's offerings. It is intended for
information purposes only and may not be incorporated into any contract. Any information
regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject
to ongoing evaluation by Pivotal and is subject to change. This information is provided without
warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's
offerings. These purchasing decisions should only be based on features currently available. The
development, release, and timing of any features or functionality described for Pivotal's offerings in
this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward
looking information in this presentation.
2
3. 2018
Coroutines
2019
Android is Kotlin first
2016
Kotlin 1.0
Kotlin on start.spring.io
Gradle Kotlin DSL
2017
Spring official Kotlin support
Android official Kotlin support
A little bit of history
29. How ReactiveX APIs translate to Coroutines
fun handler(): Mono<Void> suspend fun handler()
fun handler(): Mono<T> suspend fun handler(): T?
fun handler(): Flux<T> fun handler(): Flow<T>
30. interface WeatherService {
fun fetchWeather(location: String): Mono<Weather>
}
val location = "Lyon, France"
mainService.fetchWeather(location)
.timeout(Duration.ofSeconds(2))
.doOnError { logger.error(it.message) }
.onErrorResume { backupService.fetchWeather(location) }
.map { String.format("Weather in %s is %s", it.location, it.description) }
.subscribe { logger.info(it) }
interface WeatherService {
suspend fun fetchWeather(location: String): Weather
}
val location = "Lyon, France"
val weather = try {
withTimeout(2000L) {
mainService.fetchWeather(location)
}
} catch (ex: CancellationException) {
logger.error(ex.message)
backupService.fetchWeather(location)
}
String.format("Weather in %s is %s", weather.location, weather.description)
Reactor
declarative API
Coroutines
imperative API
46. Kofu 0.2 is work in progress
● Spring Security DSL
● Spring Data JDBC, Redis, Cassandra, JOOQ
● Type safe configuration
Spring Framework 5.2 / Spring Boot 2.2 (September 2019)
● Official Coroutines support
● Significant throughput improvements
● Significantly faster startup
● Less memory consumption
● Data classes for configuration properties
Spring Framework 5.3 (2020)
● Out of the box GraalVM native image setup 4
6