I’m trying to set up a Spring Boot Kotlin app with...
# spring
d
I’m trying to set up a Spring Boot Kotlin app with mysql/reactive. I’m following this simple example:

https://www.youtube.com/watch?v=Ug7rADxR1oE

. When I call http://localhost:8080/customers I get this 500 error though:
Copy code
Failed to obtain R2DBC Connection; nested exception is java.util.NoSuchElementException: Flux#last() didn't observe any onNext signal
I pushed the project on this public repo: https://github.com/danygiguere/spring-boot-kotlin-reactive but basically, I have this config:
Copy code
@Configuration
class Database : AbstractR2dbcConfiguration() {

    override fun connectionFactory(): ConnectionFactory
            = MySqlConnectionFactory.from(
        MySqlConnectionConfiguration.builder()
            .host("localhost")
            .username("root")
            .port(3306)
            .password("root")
            .database("reactive")
            .connectTimeout(Duration.ofSeconds(3))
            .useServerPrepareStatement()
            .build()
    )

}
my application.yml:
Copy code
spring:
    r2dbc:
        url: r2dbc:<mysql://localhost:3306/reactive?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false>
        username: root
        password: root
and the route in question is:
Copy code
@RestController
@RequestMapping("/customers")
class CustomerController(val customerRepository: CustomerRepository) {

    @GetMapping
    suspend fun getAllCustomer() : Flow<Customer> = customerRepository.findAll().asFlow()
...