Skip to content

Commit eb9b197

Browse files
committed
Adapt Cassandra documentation of v4 driver upgrade
See gh-18621
1 parent 0a6fa64 commit eb9b197

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4252,17 +4252,19 @@ There is a `spring-boot-starter-data-cassandra` "`Starter`" for collecting the d
42524252

42534253
[[boot-features-connecting-to-cassandra]]
42544254
==== 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.
42564256
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:
42584258

42594259
[source,properties,indent=0,configprops]
42604260
----
42614261
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
42634264
----
42644265

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`.
42664268

42674269
The following code listing shows how to inject a Cassandra bean:
42684270

@@ -4271,7 +4273,7 @@ The following code listing shows how to inject a Cassandra bean:
42714273
@Component
42724274
public class MyBean {
42734275
4274-
private CassandraTemplate template;
4276+
private final CassandraTemplate template;
42754277
42764278
@Autowired
42774279
public MyBean(CassandraTemplate template) {

0 commit comments

Comments
 (0)