/spring-fulfillment-demo

Spring Boot Application demo to be more Rails like

Primary LanguageJava

Fulfillment Demo Application

This is the demo Fulfillment application associated with my blog posts about my experience with Java and Spring Boot as a Ruby lover.

Auto-generated Getting Started Section

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Docker Debugging

Debugging Docker builds

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

Prometheus and Grafana locally

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:

Documentation

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.

Debugging QueryDSL

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 the target/classes/.../models folder

Future Improvements