How to use “Functional bean definition Kotlin DSL” with Spring Boot and Spring WebFlux?

后端 未结 3 1267
执笔经年
执笔经年 2021-02-05 19:12

At https://github.com/spring-projects/spring-framework/blob/master/spring-context/src/main/kotlin/org/springframework/context/support/BeanDefinitionDsl.kt the comment shows how

3条回答
  •  醉酒成梦
    2021-02-05 20:06

    Another way to do it in Spring Boot would be :

    fun main(args: Array) {
        runApplication(*args) {
            addInitializers(
                    beans {
                        // Define your bean with Kotlin DSL here
                    }
            )
        }
    }
    

提交回复
热议问题