Home > DeveloperSection > Forums > spring-data-cassandra set consistency level
Jayne Spooner
Jayne Spooner

Total Post:21

Points:147
Posted on    November-29-2015 11:45 PM

 Java Java 
Ratings:


 1 Reply(s)
 979  View(s)
Rate this:
I am using spring-data-cassandra (1.3.1.RELEASE) to connect to a cassandra database. Is there a way to change the consistency level in spring-data-cassandra. By default it is level 1. But how to change that?


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Supported
Posted on    November-30-2015 12:13 AM

It is not possible to set a custom consistency level when using the CrudRepository Interface of spring-data-cassandra. There is an open issue :
https://jira.spring.io/browse/DATACASS-14. 

Reason is that the SimpleCassandraRepository which implements the methods of the interface calls the CassandraOperations methods without the WriteOptions parameter.

My solution: I wrote a custom crudrepository implementation, in this I can set the consistency level on my own.

Don't want to miss updates? Please click the below button!

Follow MindStick