This is the demo Fulfillment application associated with my blog posts about my experience with Java and Spring Boot as a Ruby lover.
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Testcontainers Postgres Module Reference Guide
- Spring Web
- Spring Data JPA
- Spring Security
- Testcontainers
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Accessing Data with JPA
- Securing a Web Application
- Spring Boot and OAuth2
- Authenticating a User with LDAP
When needing to introspect the image after a successful build, it can be useful to override the Java entrypoint.
# Example form for the container creation
# docker run -it --entrypoint [new_command] [docker_image] [optional:value]
docker run -it --entrypoint /bin/bash fulfillment:0.0.X-SNAPSHOT
Additionally, if you need to rebuild fulfillment's image locally but don't want to tear down your postgres or rabbitmq in docker-compose:
mvn clean install -DskipTests
docker-compose up -d --no-deps --build fulfillment
Because Prometheus and Grafana are not required, they are optional to run. If there is a need/desire for validating metrics collection, you can add optionally. To run Prometheus + Grafana with your Spring Boot local environment use the following from the base directory of this repository:
docker-compose -f docker-compose.yml -f docker-prometheus/docker-compose.yml up -d
docker-compose -f docker-compose.yml -f docker-prometheus/docker-compose.yml ps
Locations as follows:
- Prometheus port 9090
- Grafana 3000
- user:pw is admin:admin
- You will need to configure the dashboard and datasource manually for now
- JVM dashboard Template
You can have Fulfillment demo generate its own OpenAPI 3.0 JSON specification using the local docker-compose setup.
mvn clean install -Dskip-tests
docker-compose up -d
curl -X GET http://localhost:8080/v3/api-docs
Or you can navigate in a web browser to OpenAPI localhost Swagger URL for the Swagger UI.
A couple of things to try if Q-classes don't generate.
- Check the plugin for JPA annotation processing querydsl#3431
- Make sure
jakarta
is the persistence driver querydsl#3436 - Run
mvn clean install -DskipTests
to run builds and check thetarget/classes/.../models
folder
- looking into strongly-typed JsonExpression queries for Postgresql in QueryDSL