Hey Folks, anybody ever build an custom ReactiveHe...
# spring
d
Hey Folks, anybody ever build an custom ReactiveHealthIndicator with kotlin coroutines? @sdeleuze maybe? Does this look right at first glance?
Copy code
@Component
class ContentClientHealthIndicator(private val contentJsonClient: ContentJsonClient) : ReactiveHealthIndicator {
    private val logger = KotlinLogging.logger { }
    private val pagesToCheck = listOf("home")
    override fun health(): Mono<Health> =
        mono(Dispatchers.Unconfined) {
            pagesToCheck.map { contentJsonClient.getPage(it) }
            Health.up().build()
        }.onErrorResume(Exception::class.java) { exception ->
            logger.error(exception) { "ContentClient health check failed" }
            Health.down(exception).build().let { Mono.just(it) }
        }
}