
io.micronaut.configuration.clickhouse.health.ClickHouseHealthConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micronaut-clickhouse Show documentation
Show all versions of micronaut-clickhouse Show documentation
This is integration between Micronaut and ClickHouse.
package io.micronaut.configuration.clickhouse.health;
import io.micronaut.configuration.clickhouse.ClickHouseSettings;
import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.context.annotation.Requires;
import io.micronaut.context.exceptions.ConfigurationException;
import java.time.Duration;
/**
* Please Add Description Here.
*
* @author Anton Kurako (GoodforGod)
* @since 13.08.2021
*/
@Requires(property = ClickHouseSettings.PREFIX)
@ConfigurationProperties(ClickHouseSettings.PREFIX + ".health")
public class ClickHouseHealthConfiguration {
private boolean enabled = true;
private Duration timeout = Duration.ofSeconds(10);
private int retry = 2;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public Duration getTimeout() {
return timeout;
}
public void setTimeout(Duration timeout) {
if (timeout == null)
return;
if (timeout.isNegative())
throw new ConfigurationException("Timeout for health can not be less than 0");
this.timeout = timeout;
}
public int getRetry() {
return retry;
}
public void setRetry(int retry) {
if (retry < 1)
throw new ConfigurationException("Retry for health can not be less than 1");
this.retry = retry;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy