Set up the postgres database according to application.properties
file or run docker-compose up
in src/main/resources
to deploy
postgres
image.
If you are using Docker
for postgres
database be sure to modify application.properties
according to docker-compose.yml
file.
Use user, password, and port from docker config:
version: "3.9"
services:
db:
image: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
ports:
- "5499:5432"
volumes:
- reactive_data:/var/lib/postgresql/data
volumes:
reactive_data:
Next step is to define the schema and tables.
Please use the script provided in schema.sql
to create the schema and needed tables.
The application uses Spring Boot so it is easy to run. You can start it any of a few ways:
- Run the main method from
ReactiveApiApplication
- Use the Maven Spring Boot plugin:
mvn spring-boot:run
Two routes are exposed in ProductController
:
/products
- to get merged and formatted products from heroku routes and store metadata for each heroku request/products/stats
- for getting response time statistics for a current day
Enjoy.
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Data R2DBC
The following guides illustrate how to use some features concretely:
These additional references should also help you:
Make sure to include a R2DBC Driver to connect to your database.