Set up cassandra

This commit is contained in:
2024-11-30 13:36:52 +01:00
parent dd005475aa
commit e4e652fd9d
4 changed files with 37 additions and 3 deletions

View File

@@ -4,9 +4,16 @@ A vault of secrets, a treasure untold, Configurations gathered, both new and old
## Properties for deployment ## Properties for deployment
| name | required | info | | name | required | info |
|------------------------|----------|-------------------------| |----------------------------|----------|-------------------------|
| spring.profiles.active | * | Spring Boot environment | | spring.profiles.active | * | Spring Boot environment |
| cassandra.keyspace-name | | |
| cassandra.port | | |
| cassandra.schema-action | | |
| cassandra.local-datacenter | | |
| cassandra.contact-points | * | |
| cassandra.username | * | |
| cassandra.password | ** | |
Required: * can be stored as text, and ** need to be stored as secret. Required: * can be stored as text, and ** need to be stored as secret.

View File

@@ -7,9 +7,14 @@ plugins {
} }
dependencies { dependencies {
implementation(hlaeja.fasterxml.jackson.module.kotlin)
implementation(hlaeja.kotlin.logging)
implementation(hlaeja.kotlin.reflect) implementation(hlaeja.kotlin.reflect)
implementation(hlaeja.kotlinx.coroutines) implementation(hlaeja.kotlinx.coroutines)
implementation(hlaeja.library.hlaeja.common.messages)
implementation(hlaeja.springboot.starter.actuator) implementation(hlaeja.springboot.starter.actuator)
implementation(hlaeja.springboot.starter.cassandra)
implementation(hlaeja.springboot.starter.cassandra.reactive)
implementation(hlaeja.springboot.starter.webflux) implementation(hlaeja.springboot.starter.webflux)
testImplementation(hlaeja.kotlin.test.junit5) testImplementation(hlaeja.kotlin.test.junit5)

View File

@@ -0,0 +1,6 @@
-- Create a keyspace
CREATE KEYSPACE IF NOT EXISTS device_configuration
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
-- Use the keyspace
USE device_configuration;

View File

@@ -10,6 +10,12 @@ spring:
name: "%APP_BUILD_OS_NAME%" name: "%APP_BUILD_OS_NAME%"
version: "%APP_BUILD_OS_VERSION%" version: "%APP_BUILD_OS_VERSION%"
cassandra:
keyspace-name: device_configuration
port: 9042
schema-action: none
local-datacenter: datacenter1
--- ---
############################### ###############################
### Development environment ### ### Development environment ###
@@ -19,6 +25,11 @@ spring:
activate: activate:
on-profile: development on-profile: development
cassandra:
contact-points: localhost
username: cassandra
password: password
--- ---
########################## ##########################
### Docker environment ### ### Docker environment ###
@@ -28,6 +39,11 @@ spring:
activate: activate:
on-profile: docker on-profile: docker
cassandra:
contact-points: cassandra
username: cassandra
password: password
--- ---
############################## ##############################
### Production environment ### ### Production environment ###