Spring Data for Apache Cassandra example
*Local OR Docker install (select only one)
echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
sudo apt-get update
sudo apt-get install cassandra
for more details cassandra.apache.org
sudo docker run --name dev-cassandra -p 7000:7000 -p 7001:7001 -p 9160:9160 -p 9042:9042 -d cassandra:3.11.2
docker exec -it __CONTAINER_ID__ cqlsh
curl -X POST \
http://localhost:8080/persons \
-H 'Content-Type: application/json' \
-d '{
"uuid": "8781d82d-08bc-4148-b00f-4ad7750b4934",
"email": "cemserit@gmail.com",
"name": "Cem Serit",
"age": 27
}'
curl -X PUT \
http://localhost:8080/persons/8781d82d-08bc-4148-b00f-4ad7750b4934 \
-H 'Content-Type: application/json' \
-d '{
"uuid": "8781d82d-08bc-4148-b00f-4ad7750b4934",
"email": "cemserit@gmail.com",
"name": "Cem",
"age": 27
}'
curl -X GET \
http://localhost:8080/persons
curl -X GET \
http://localhost:8080/persons/8781d82d-08bc-4148-b00f-4ad7750b4934
curl -X GET \
http://localhost:8080/persons?age=27
curl -X GET \
http://localhost:8080/persons?email=cemserit@gmail.com&age=27
curl -X DELETE \
http://localhost:8080/persons/8781d82d-08bc-4148-b00f-4ad7750b4934