This repository is a parallel project to Learning Webflux 3.0 (module kotlin.06-data-access) and is used for learning R2DBC with Spring WebFlux.
It was created separately because the original repository had connection issues with the R2DBC driver.
This repository serves as a proof of concept (POC) to explore and test the R2DBC setup more reliably.
- Docker and Docker Compose
docker-compose -f docker/compose.yml --env-file .env up -dTo stop the databases:
docker-compose -f docker/compose.yml --env-file .env down -v./gradlew clean buildSERVER_PORT=8089 \
MONGO_USER=mongo \
MONGO_PASSWORD=mongo \
MONGO_AUTH_DB=admin \
PG_USER=postgres \
PG_PASSWORD=postgres \
./gradlew bootRunSERVER_PORT=8089 \
MONGO_USER=mongo \
MONGO_PASSWORD=mongo \
MONGO_AUTH_DB=admin \
PG_USER=postgres \
PG_PASSWORD=postgres \
./gradlew bootRun --args='--spring.profiles.active=springdata'SERVER_PORT=8089 \
MONGO_USER=mongo \
MONGO_PASSWORD=mongo \
MONGO_AUTH_DB=admin \
PG_USER=postgres \
PG_PASSWORD=postgres \
./gradlew bootRun --args='--spring.profiles.active=mongo'./gradlew testRef: https://java.testcontainers.org/supported_docker_environment/#colima
colima start --network-address
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE="$HOME/.colima/default/docker.sock"
export TESTCONTAINERS_HOST_OVERRIDE=$(colima ls -j | jq -r '.address')
export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"Get All Customers:
curl localhost:8089/fe/customersGet Customer by ID:
curl localhost:8089/fe/customers/:idCreate Customer:
curl -X POST localhost:8089/fe/customers \
-H "Content-Type: application/json" \
-d '{"email": "<email_to_create>"}'Update Customer:
curl -X PATCH localhost:8089/fe/customers/:id \
-H "Content-Type: application/json" \
-d '{"email": "<email_to_update>"}'Delete Customer:
curl -X DELETE localhost:8089/fe/customers/:idGet All Customers:
curl localhost:8089/rc/customersGet Customer by ID:
curl localhost:8089/rc/customers/:idCreate Customer:
curl -X POST localhost:8089/rc/customers \
-H "Content-Type: application/json" \
-d '{"email": "<email_to_create>"}'Update Customer:
curl -X PATCH localhost:8089/rc/customers/:id \
-H "Content-Type: application/json" \
-d '{"email": "<email_to_update>"}'Delete Customer:
curl -X DELETE localhost:8089/rc/customers/:id