Comments (3)
Sorry, I misunderstood your question and now that you've posted some code, it made it clear what you're asking for. So SessionBuilderConfigurer
available on AbstractSessionConfiguration
and its subclasses is the way to go.
It makes sense to document SessionBuilderConfigurer
in our reference documentation to make it easier to find what you were asking for.
from spring-data-cassandra.
AbstractReactiveCassandraConfiguration
creates a CQL session when configuring beans.
If you want to build a configuration that is robust against Cassandra absence, then you cannot:
- Use schema support
- A configuration built on
Abstract…CassandraConfiguration
You also need to provide a SessionFactory
implementation to defer session creation to a later time.
from spring-data-cassandra.
Thanks but I want to ask if this works. I looked at how spring boot configures CqlSession for Astra Db. There is CqlSessionCustomizer
that does the job. Spring boot setups CqlSession
via a CqlSessionBuilder
setting contact points, setting keyspace etc but at the end calling the customizer.
According to this stack question and examples in datastax repos something like below does the job:
@Bean
public CqlSessionBuilderCustomizer sessionBuilderCustomizer(DataStaxAstraProperties astraProperties) {
Path bundle = astraProperties.getSecureConnectBundle().toPath();
return builder -> builder.withCloudSecureConnectBundle(bundle);
}
Almost same identical code exists in normal spring data cassandra. in AbstractSessionConfiguration
there is method SessionBuilderConfigurer
. What happens here is almost the same thing that happens in spring boot. So I wonder if the following does the job of connecting to astra Db with connect bundle file:
public class ReactiveCassandraConfig extends AbstractReactiveCassandraConfiguration {
private String keySpace;
private String connectBundlePath;
@Override
protected String getKeyspaceName() {
return keySpace;
}
@Override
protected SessionBuilderConfigurer getSessionBuilderConfigurer() {
return sessionBuilder -> sessionBuilder
.withCloudSecureConnectBundle(Path.of(connectBundlePath));
}
}
from spring-data-cassandra.
Related Issues (20)
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Datastax java-driver maven coordinates have changed HOT 1
- Release 4.1.9 (2023.0.9)
- Release 4.2.3 (2023.1.3)
- Constructor with `@Column`-annotated arguments leads to memory leak
- DTO projections causes the converter to be called twice
- Codec not found for requested operation using a `Set` of mapped User Defined Type HOT 3
- Documentation is out of date HOT 3
- Refine documentation
- Revise `@PrimaryKey` to be an alias for `@Column` HOT 1
- Add support for ValueExpression
- Release 4.1.10 (2023.0.10)
- Release 4.2.4 (2023.1.4)
- Release 4.3 M2 (2024.0.0)
- How do I add converter from Instant to org.joda.time.DateTime to spring-data-commons-3.2.1 and spring-data-cassandra-4.2.1 HOT 8
- Release 4.1.11 (2023.0.11)
- Release 4.2.5 (2023.1.5)
- Release 4.3 RC1 (2024.0.0)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-cassandra.