@@ -4252,17 +4252,19 @@ There is a `spring-boot-starter-data-cassandra` "`Starter`" for collecting the d
4252
4252
4253
4253
[[boot-features-connecting-to-cassandra]]
4254
4254
==== Connecting to Cassandra
4255
- You can inject an auto-configured `CassandraTemplate` or a Cassandra `Session ` instance as you would with any other Spring Bean.
4255
+ You can inject an auto-configured `CassandraTemplate` or a Cassandra `CqlSession ` instance as you would with any other Spring Bean.
4256
4256
The `spring.data.cassandra.*` properties can be used to customize the connection.
4257
- Generally, you provide `keyspace-name` and `contact-points` properties , as shown in the following example:
4257
+ Generally, you provide `keyspace-name` and `contact-points` as well the local datacenter name , as shown in the following example:
4258
4258
4259
4259
[source,properties,indent=0,configprops]
4260
4260
----
4261
4261
spring.data.cassandra.keyspace-name=mykeyspace
4262
- spring.data.cassandra.contact-points=cassandrahost1,cassandrahost2
4262
+ spring.data.cassandra.contact-points=cassandrahost1:9042,cassandrahost2:9042
4263
+ spring.data.cassandra.local-datacenter=datacenter1
4263
4264
----
4264
4265
4265
- You can also register an arbitrary number of beans that implement `ClusterBuilderCustomizer` for more advanced customizations.
4266
+ You can also register an arbitrary number of beans that implement `DriverConfigLoaderBuilderCustomizer` for more advanced driver customizations.
4267
+ The `CqlSession` can be customized with a bean of type `CqlSessionBuilderCustomizer`.
4266
4268
4267
4269
The following code listing shows how to inject a Cassandra bean:
4268
4270
@@ -4271,7 +4273,7 @@ The following code listing shows how to inject a Cassandra bean:
4271
4273
@Component
4272
4274
public class MyBean {
4273
4275
4274
- private CassandraTemplate template;
4276
+ private final CassandraTemplate template;
4275
4277
4276
4278
@Autowired
4277
4279
public MyBean(CassandraTemplate template) {
0 commit comments