ClickHouseClients
object ClickHouseClients
The ClickHouse connection settings (wow.clickhouse.*) the Sink and the dataset backend share, and the client-v2 Client of them. Both find their client by one rule (clientOf): the application's Client bean when it has one, which Wow never closes; else one of these settings, which each opens and closes itself; with neither, a Sink that is switched on fails the start, naming both ways.
An application that wants one shared client, or uses ClickHouse itself, declares the bean over the same settings, bound with Spring's Binder (Bindable.mapOf(String::class.java, String::class.java) of wow.clickhouse), and closes it with its context: @Bean(destroyMethod = "close") fun clickHouse(...) = ClickHouseClients.of(settings).