简体   繁体   中英

Is Java driver v3.6 compatible with Cassandra 4.x?

I am writing to check the check the compatibility of Datastax cassandra-driver-core 3.6 for working with Cassandra Version 4. Could you please suggest. below is the dependency currently being used, Checking if same dependency will work for Cassandra version 4.0

            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>3.6.0</version>

I did refer this post, which says it is compatible. However, it dint work out for me. If you may comment for the support part to check further

Apache Cassandra 4.x java driver compatibility

Version 3.6 of the Java driver is compatible with Apache Cassandra 4.0 but there are additional steps required to make it work.

Cassandra 4.0 operates with native protocol v5 ( CASSANDRA-9362 , CASSANDRA-14973 ) but Java driver v3.6 supports up to native protocol v3 only (C* 2.2, 3.x). In order to connect to a C* 4.0 cluster, you will need to configure Java driver v3.6 to explicitly use protocol v3. For example:

Cluster cluster = Cluster.builder()
    .addContactPoint(contactpoint)
    .withProtocolVersion(ProtocolVersion.V3)
    .build();

As a side note, v3.6 of the driver was released in 2018 and is very old. We recommend that you upgrade to the latest v3.x version of the Java driver which at the time of writing is v3.11. Since it is just an upgrade to the latest patch release , it is binary compatible with v3.6 and does not require a refactor of your application. Cheers!


Please support the Apache Cassandra community by hovering over the tag then click on the Watch tag button. Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM