Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
eb9b1972
Commit
eb9b1972
authored
Jan 23, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt Cassandra documentation of v4 driver upgrade
See gh-18621
parent
0a6fa64f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
spring-boot-features.adoc
...ing-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
+7
-5
No files found.
spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc
View file @
eb9b1972
...
...
@@ -4252,17 +4252,19 @@ There is a `spring-boot-starter-data-cassandra` "`Starter`" for collecting the d
[[boot-features-connecting-to-cassandra]]
==== Connecting to Cassandra
You can inject an auto-configured `CassandraTemplate` or a Cassandra `Session` instance as you would with any other Spring Bean.
You can inject an auto-configured `CassandraTemplate` or a Cassandra `
Cql
Session` instance as you would with any other Spring Bean.
The `spring.data.cassandra.*` properties can be used to customize the connection.
Generally, you provide `keyspace-name` and `contact-points`
properties
, as shown in the following example:
Generally, you provide `keyspace-name` and `contact-points`
as well the local datacenter name
, as shown in the following example:
[source,properties,indent=0,configprops]
----
spring.data.cassandra.keyspace-name=mykeyspace
spring.data.cassandra.contact-points=cassandrahost1,cassandrahost2
spring.data.cassandra.contact-points=cassandrahost1:9042,cassandrahost2:9042
spring.data.cassandra.local-datacenter=datacenter1
----
You can also register an arbitrary number of beans that implement `ClusterBuilderCustomizer` for more advanced customizations.
You can also register an arbitrary number of beans that implement `DriverConfigLoaderBuilderCustomizer` for more advanced driver customizations.
The `CqlSession` can be customized with a bean of type `CqlSessionBuilderCustomizer`.
The following code listing shows how to inject a Cassandra bean:
...
...
@@ -4271,7 +4273,7 @@ The following code listing shows how to inject a Cassandra bean:
@Component
public class MyBean {
private CassandraTemplate template;
private
final
CassandraTemplate template;
@Autowired
public MyBean(CassandraTemplate template) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment