use of org.springframework.boot.autoconfigure.cassandra.CassandraProperties.Connection in project spring-boot by spring-projects.
the class CassandraAutoConfiguration method mapConnectionOptions.
private void mapConnectionOptions(CassandraProperties properties, CassandraDriverOptions options) {
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
Connection connectionProperties = properties.getConnection();
map.from(connectionProperties::getConnectTimeout).asInt(Duration::toMillis).to((connectTimeout) -> options.add(DefaultDriverOption.CONNECTION_CONNECT_TIMEOUT, connectTimeout));
map.from(connectionProperties::getInitQueryTimeout).asInt(Duration::toMillis).to((initQueryTimeout) -> options.add(DefaultDriverOption.CONNECTION_INIT_QUERY_TIMEOUT, initQueryTimeout));
}
Aggregations