Skip to content

quantum-fusion/springboot_swagger_example-master-cassandra

Repository files navigation

REST Spring Boot with Database and OpenAPI Swagger Interfaces:

Get Started

git clone https://github.com/quantum-fusion/springboot_swagger_example-master-cassandra

cd springboot_swagger_example-master-cassandra

mvn clean install

./draft.up

./draft.connect

curl http://localhost:12345/restaurant/helloworld

Key Benefits of Spring Boot REST Server with OpenAPI standard

Tools: DataStax CQL IDE Editor for MACOS (http://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/devcenter/dcToc.html )

ScyllaDB Supported with Cassandra CQL:

https://hub.docker.com/r/scylladb/scylla/ https://www.scylladb.com/download/amazon/

Known Limitations:

Integration Tests to Consider:

AWS Cassandra Single Click(tested successfully):

Other Cassandra multi-node cluster providers to Consider(not yet tested):

Setup Options 1 or 2 or 3 or All:

    1. Run Local SpringBoot and Cassandra single node.
    1. Run Local Docker SpringBoot and Local Docker Cassandra single node.
    1. Run Local Kubernetes SpringBoot and remote AWS Bitnami Cassandra single node, requires configurable IP and login credentials.
  • All: SpringBoot will run on all platforms and support remote AWS Bitnami Cassandra single node, with configurable IP address and login credentials.

Installation Instructions:

// spring-boot_swagger_example-master-cassandra Project

Build project

mvn clean install

Step1: get Apache Cassandra running locally or in Docker (see Step2).

cd apache-cassandra*

./run

cd ..

Step2: Run service locally

java -jar ./target/spring-boot-web-0.0.1-SNAPSHOT.jar

Step3: Run web browser to generate Swagger docs and tests

Execute localhost:8080/v2/api-docs in web browser. Execute localhost:8080/swagger-ui.html in web browser.

Step4: Configure service IP address for remote database ipaddress

java -jar ./target/spring-boot-web-0.0.1-SNAPSHOT.jar -Dcassandra_ip= -Dcassandra_port=9042 -Dlogin=cassandra -Dpassword=GN1aJxMnsWOR

Step5: REST based configuration for Kubernetes support of remote Cassandra nodes due to Google Kubernetes not supporting Templates.

(Optional): curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' -d '{ \ "cassandraIpAddress": "", \ "cassandraPort": "9042", \ "login": "cassandra", \ "password": "GN1aJxMnsWOR" \ }' 'http://localhost:8080/restaurant/testarguments'

Step6: Build Docker image (see ./dockerbuild/README.md)

cd ./dockerbuild

./build.script

./upload.script

cd ..

Step7 (Optional): run Docker instances Locally

./runDockerApplication

./testDockerApplication

Step8 (Optional): Install Kubernetes, and Launch REST service (see ./Kubernetes/README.md)

cd ./Kubernetes

./minikube.run

must manually delete prior images and pods from ghost defunct pod services

./minikube.setup

must check ip addresses for kubernetes master ip address

./kubectl.test

Cleanup

./minikube.stop

Releases

No releases published

Packages

No packages published

Languages