redis-server
gcloud components install cloud-firestore-emulator
gcloud beta emulators firestore start --host-port=:8662
OR
gcloud components install bigtable
gcloud beta emulators bigtable start --host-port=0.0.0.0:8086
export BIGTABLE_EMULATOR_HOST=localhost:8086
cbt -project "project-id" -instance "bus-instance" createtable chat_messages
cbt -project "project-id" -instance "bus-instance" createfamily chat_messages chatRoomDetails
cbt -project "project-id" -instance "bus-instance" createfamily chat_messages chatMessageDetails
cbt -project "project-id" -instance "bus-instance" read chat_messages
OR
gcloud components install spanner
gcloud emulators spanner start
# In another window
gcloud config configurations create emulator
gcloud config set auth/disable_credentials true
gcloud config set project sample-project
gcloud config set api_endpoint_overrides/spanner http://localhost:9020/
gcloud spanner instances create test-instance \
--config=emulator-config --description="Test Instance" --nodes=1
# With Firestore
SPRING_PROFILES_ACTIVE="local,firestore" ./gradlew bootRun
# With Bigtable
SPRING_PROFILES_ACTIVE="local,bigtable" ./gradlew bootRun
# With Spanner
SPRING_PROFILES_ACTIVE="local,spanner" ./gradlew bootRun
curl -v -X POST \
-H "Content-type: application/json" \
-H "Accept: application/json" \
http://localhost:8080/chatrooms \
-d '{
"id": "some-room",
"name": "some-room"
}'
curl -v http://localhost:8080/chatrooms/some-room
curl -v http://localhost:8080/messages/some-room
curl -v -X POST \
-H "Content-type: application/json" \
-H "Accept: application/json" \
http://localhost:8080/messages/some-room \
-d '{
"payload": "hello world"
}'
It should show up on the previous GET endpoint