Simple Scala app to learn about Cassandra integration.
To run the application and Cassandra together via docker-compose, from the root of the project run the
following ./sbt dockerComposeUp
.
- Run this from the root of the project
./docker/CassandraVanillaDocker.sh
, wait a few seconds (up to 10/20) for Cassandra to become ready. - Start the app up in IntelliJ.
The following sbt command will start the required docker containers, run the tests (with a readiness check waiting for the app to become ready), and then stop and remove all containers.
./sbt runAllTests
curl localhost:8080/videos/<userId>
curl localhost:8080/videos/<userId>/<n>
curl -X PUT localhost:8080/videos/<userId>/<videoId>
curl -X DELETE localhost:8080/videos/<userId>/<videoId>
Metrics surfaced by Kamon are exposed here -> http://localhost:9095/metrics
cassandra_reachable
- value of 1 represents "true", cassandra is reachable, this is the default value on startup
- code to be added to set this to 0 ("false") in the event cassandra is unreachable
docker exec -it cassandra_container_name_or_id cqlsh
describe keyspaces
use keyspace_name;
describe tables;
select * from table_name;
- https://docs.datastax.com/en/developer/java-driver/4.9
- https://www.baeldung.com/cassandra-datastax-java-driver
- https://github.com/Tapad/sbt-docker-compose
- https://docs.datastax.com/en/developer/java-driver/3.6/manual/metrics/#metrics-4-compatibility
- (JMX issue) - justification for creating a cluster using
.withoutJMXReporting
- (JMX issue) - justification for creating a cluster using
- https://getquill.io/
- https://kamon.io/docs/latest/guides/how-to/start-with-the-kanela-agent/#using-sbt-native-packager