spring-data-cassandra set consistency level

K.E. picture K.E. · Nov 25, 2015 · Viewed 9k times · Source

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 (What is the default consistency level in spring-data-cassandra?). But how to change that?

Thank you!

Answer

Hasson picture Hasson · Apr 11, 2017

You can now set this level in spring boot by setting the following properties in application.properties file.

spring.data.cassandra.consistency-level=quorum
spring.data.cassandra.serial-consistency-level=quorum