Spring Fu is an incubator for new Spring features about Kotlin and functional bean registration. Its main feature is an alternative way of configuring Spring Boot applications with Kotlin DSL and lambdas instead of annotations: Kofu (for Kotlin and functional) configuration. Other features like Coroutines or GraalVM support are also included.
A Java variant called Jafu (for Java and functional) is also available (just a POC for now).
It is not intended to be used in production, but rather to incubate and get feedback and contributions from the community in order to reach a point where its features can be integrated as part of existing Spring projects like Framework, Boot and Data. The table bellow summarize the status of current features.
Feature | Status | Related issue |
---|---|---|
Incubating in Spring Fu |
Slightly related: spring-boot#8115 To be created in Spring Boot issue tracker |
|
Manually created in Spring Fu Experimented by Dave Syer in spring-init-experiment and spring-boot-micro-apps Could be generated during Spring Boot build in the future |
To be created in Spring Boot issue tracker |
|
Incubating in Spring Fu |
SPR-15413 kotlinx.coroutines#254 kotlinx.coroutines#284 To be created in Spring Data issue tracker for MongoDB and SQL support |
|
Data classes support for configuration properties |
Expected in Spring Boot 2.2 (to be confirmed) |
|
Initial support done in Spring Framework 5.1 Work in progress on GraalVM side |
||
Better Kotlin documentation |
Not started yet |
|
Pull-request to be contributed |
||
Incubating in Spring Fu |
||
Not started yet |
||
Not started yet |
-
Create a Spring 2.1.0.M4 project on start.spring.io,
-
Add the
org.springframework.fu:spring-boot-kofu:0.0.3.BUILD-SNAPSHOT
dependency -
Use Kotlin
1.3.0-rc-57
available fromhttp://dl.bintray.com/kotlin/kotlin-eap
Maven repository. -
Modify the generated
*Application.kt
file as following:
package com.example
import org.springframework.boot.kofu.application
val app = application {
// ...
}
fun main(args: Array<String>) = app.run(args)
Bootstraps are zip archives containing minimal project templates designed to allow you getting started
quickly and easily Spring Fu applications using a Gradle DSL build. To start a new project, download
a bootstrap .zip
archive, extract it and follow README.adoc
instructions.
In addition to the whole Spring and Reactor teams, special credits to:
-
Juergen Hoeller for his support on Kotlin and the functional bean registration API
-
Arjen Poutsma for creating the WebFlux functional API
-
Thomas Girard for its spring-webflux-kotlin-dsl experiment that initially demonstrated this approach was possible
-
Konrad Kaminski for his awesome spring-kotlin-coroutine project
-
Dave Syer for his work on benchmarks, GraalVM support and functional bean registration applied to Boot
-
The whole Spring Boot team