- Create a GCP Project
- Setup Firestore in the Datastore Mode.
- Create a JSON key for local testing
mvn clean package
docker build . -t profile-service
java -jar
brew services start redis
java -jar target/profile-service-0.0.1-SNAPSHOT.jar
Note for running in docker create a service account key with datastore read/write permission and add following lines in the Dockerfile
COPY key.json /key.json
ENV GOOGLE_APPLICATION_CREDENTIALS=/key.json
docker run -p 8080:8080 profile-service
gcloud app deploy
GET http://localhost:8080/profiles
GET http://localhost:8080/profiles/Ghosh
curl -v -X POST \
-d '{"name":"Ghosh", "country":"India", "birthYear":1991}' \
-H "Content-Type: application/json" \
http://localhost:8080/profiles
ab -p data.txt -T application/json -H \
"Content-Type: application/json" -c 100 -n 20000 \
https://cloud-on-air-2019.appspot.com/profiles
curl -v -X DELETE \
http://localhost:8080/profiles
curl -v -X DELETE \
https://cloud-on-air-2019.appspot.com/profiles
Add the following to the end of curl command to measure execution time
-w "\nExecution Time - %{time_starttransfer}\n"
For further reference, please consider the following sections:
The following guides illustrate how to use some features concretely:
This skeleton of the project was originally generated using the following
curl https://start.spring.io/starter.tgz \
-d packaging=war \
-d dependencies=cloud-gcp \
-d baseDir=profile-service \
-d bootVersion=2.1.1.RELEASE | tar -xzvf -