-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Cassandra driver 4 #18621
Comments
Spring Data Cassandra issue to upgrade the driver: DATACASS-656. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm not sure that it's worth us offering auto-configuration for the new driver before Spring Data for Apache Cassandra has caught up, particularly with all the other things going on at the moment. I've placed this on hold until the update in Spring Data has been scheduled. |
I'm in the middle of migrating Spring Data to the 4.x driver. I noticed that running both drivers, 3.x and 4.x side-by-side does not work because of netty incompatibilities. Timing-wise it would make sense to synchronize Driver and Spring Data upgrades. |
I summarized the changes for the Cassandra migration (from a Spring Data perspective) at spring-projects/spring-data-cassandra#167. Snapshot builds are available for the |
Hi, DataStax has been working lately on a Spring Boot module for Apache Cassandra and DSE. It uses the DataStax driver 4.x and offers out-of-the-box driver configuration and injection of session beans. Driver configuration is created by merging info from other Spring beans, Spring configuration sources and driver configuration files. Spring profiles are also honored. It also offers health indicators and metrics (driver metrics are translated into Micrometer metrics). We would like to donate this code to you. Could you please tell us what is the best way to proceed? Feel free to ping me privately if necessary: |
@adutra Is the module currently open source? Can we take a quick look at the code to see what's involved? |
@philwebb it's not, it's still in beta preview. I will grant you access to the repo. Anyone else that you would like to be able to browse that repo as well? |
Thanks @adutra. Could you please give access to @wilkinsona and @snicoll as well. |
Absolutely! Please feel free to leave comments and/or open issues. |
Spring Data for Apache Cassandra is now available in the Neumann release train. The Spring Data BOM points to version |
The upgrade is taken care of as part of #19588. There are a number of things we can do to ease the upgrade from a user's perspective.
@adutra the project you've shared with us was helpful to better understand some of the changes in v4, thank you! Can you please look at the above? Our plan for M1 is to map the existing keys that we current have with v3, deprecating those who are not reflected in the new driver anymore. Future milestone will improve the configuration by offering additional mappings (I've added some suggestions but I am sure we'll have more). @mp911de thank you so much for the assistance. Upgrading Spring Data was relatively straightforward. I haven't managed to fix the integration tests yet as I don't understand how I should/can create the keyspace. I'll resume work on this next week to make sure the integration tests are green too. |
This snipped translates to what was previously done with private void createTestKeyspaceIfNotExists() {
try (CqlSession session = CqlSession.builder()
.addContactPoint(new InetSocketAddress(cassandra.getContainerIpAddress(), cassandra.getFirstMappedPort()))
.withLocalDatacenter("datacenter1")
.build()) {
session.execute("CREATE KEYSPACE IF NOT EXISTS boot_test"
+ " WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };");
}
} I'm not sure why |
This is now superseded by #19588 and a number of issues that I've just created (see above). We'll continue improving Cassandra v4 support in future 2.3 milestones and welcome feedback. |
I think we should keep this in 2.3.0.M1 so that it appears in the release notes. |
@snicoll I replied to most of your bullet points above under the respective issues that you created.
Beware that the driver uses a colon to separate the address from the port, as in adress:port; if the port is made optional, this could lead to ambiguities when using IPv6 addresses in compact format, that is, a contact point ending with |
@adutra thanks, I thought of that one and was considering doing the replacement only for basic cases (i.e. no presence of |
The Cassandra 4 driver comes with several changes (in comparison to the 3.x driver). An upgrade requires some coordination as the 4.0 driver comes with:
com.datastax.driver
, new:com.datastax.oss.driver.api
) and new maven coordinates (com.datastax.cassandra:cassandra-driver-core
vs. newcom.datastax.oss:java-driver-core
)Cluster
concept in favor of a singleCqlSession
entry point)Special attention deserves
DriverConfigLoader
that is a configuration utility to load driver config from a.conf
/.json
/.properties
file and the fact that although Guava is no longer required as a dependency, the driver still uses a shaded variant of Guava.It looks as if both drivers could be used side by side until Spring Data for Apache Cassandra and Zipkin are able to catch up.
The text was updated successfully, but these errors were encountered: