使用CassandraAutoConfiguration时yml配置应如何配置Class<? extends ...>
字段,例如reconnectionPolicy: com.datastax.driver.core.policies.ConstantReconnectionPolicy
with delayMs = 3000
答案 0 :(得分:0)
所以似乎提供ClusterBuilderCustomizer自定义属性是唯一的选择。
@Bean
public ClusterBuilderCustomizer clusterBuilderCustomizer(CassandraBaseProperties properties) {
return builder -> builder.withReconnectionPolicy(
new ConstantReconnectionPolicy(properties.getReconnectionPolicyConstantDelayMs()));
}