Kandra

val Kandra: ApplicationPlugin<KandraConfig>

Ktor plugin that wires ScyllaDB/Cassandra via the DataStax Java driver.

Built and tested against Ktor 3.6.x (ktor-server-core 3.6.0, see gradle.properties' ktorVersion). Ktor 2.x is not supported; see GH #160.

install(Kandra) {
contactPoints = "localhost:9042"
keyspace = "coinx"
localDatacenter = "datacenter1"
autoCreateKeyspace = true
schemaMode = SchemaMode.AUTO_CREATE
register(User::class, Wallet::class)
pool { requestTimeoutMillis = 10_000 }
auth { provider = KandraAuth.fromEnv() }
retry { maxAttempts = 5 }
debug { logQueries = true; logSlowQueriesMs = 500 }
eventListener = object : KandraEventListener { ... }
}