Compilation of a Kotlin function, that is annotated with @Consistency, results in compilation error "An annotation argument must be a compile-time constant". Note that fhis feature worked well in spring-data-cassandra-2.1.X.
I suppose there is a good reason for the way the DefaultConsistencyLevel enum is structured, i.e. implementing an interface, that in turn has references back to the enum, and having name collisions between interface fields and enum values. If you've an open channel with the Kotlin team, then check with them if they'd be willing to support this usecase.
Make @Consistency annotation's value attribute optional. Add another int/String/??? attribute that maps to a DefaultConsistencyLevel.
Add a note to the reference document stating that this feature is not compatible with Kotlin
The current arrangement isn't ideal as we're referring to a driver class that is internal. We don't want to keep our own ConsistencyLevel copy nor perform a string lookup as these approaches create further issues like inconsistencies. We also cannot refer to the ConsistencyLevel interface as annotation values need to be constant.
Paging Alexandre Dutra, maybe there's something that can be done on the driver side to improve here