MicroserviceModule is currently a collection of Spring Boot proof-of-concept applications packaged as one Maven JAR. It demonstrates REST APIs, JPA, response streaming, PostgreSQL/H2 integration, AWS S3 access, and Micrometer instrumentation.
It is not currently a single microservice and it is not yet a deployable microservice suite. Four independent @SpringBootApplication classes, unrelated dependencies, and shared source/resource directories are combined in one artifact.
For the recommended target structure and migration sequence, see CONSOLIDATION_PLAN.md.
| Application or area | Entry point | Port and context path | Persistence | Purpose | Current state |
|---|---|---|---|---|---|
| Course | basicWebApp.courseApp.CourseApp |
8082, /courseApp |
File-backed H2 | JPA relationships, custom repositories, mapping, pagination, transactions | Compiles; repository/entity scan packages do not match the Java packages |
| Jewellery | basicWebApp.jewelleryApp.JewelleryApp |
8086, /jewelleryApp |
None | REST, validation, serialization, API versioning, error handling, HTTP clients | Most self-contained application |
| Stock | modernWebApp.stockApp.StockApp |
8084, /stockApp |
None | Bulk JSON, downloads, NDJSON, ResponseBodyEmitter, and SSE |
Runnable demonstration; manually creates threads for streaming |
| Shopping | modernWebApp.shoppingApp.ShoppingApp |
8085, /shoppingApp |
Intended PostgreSQL | Customer, product, cart, and order workflow | Configuration is incomplete and package scans do not match source packages |
| AWS S3 | No entry point | None | AWS S3 | Read an S3 object | Outside every application's default component scan |
| Observability | No entry point | Properties specify 8086, /observabilityApp |
None | Custom Micrometer counter endpoint | Outside every application's default component scan; port conflicts with Jewellery |
| Utility | No entry point | None | None | Console-print helper | Shared by location rather than by an explicit module contract |
Inventory at review time (2026-08-08): 91 Java source files, approximately 2,965 lines in the areas above, 13 resources, four Spring Boot entry points, and no test source files.
MicroserviceModule/
├── pom.xml # Inherits all root dependencies
└── src/main/
├── java/
│ ├── basicWebApp/
│ │ ├── courseApp/ # Course application
│ │ └── jewelleryApp/ # Jewellery application
│ ├── modernWebApp/
│ │ ├── shoppingApp/ # Shopping application
│ │ └── stockApp/ # Stock application
│ ├── aws/storage/s3/ # Dormant S3 adapter
│ ├── observabilityApp/ # Dormant metrics components
│ └── util/ # Generic helper
└── resources/microservice/ # One properties file per demo
From the repository root:
.\mvnw.cmd -pl MicroserviceModule testThe command completed successfully on 2026-08-08 with Java release 25. It compiled 91 sources but ran no tests. The build also reported:
- no
src/main/protodirectory even though the inherited protobuf plugin runs; - Lombok builder-default warnings;
- unmapped MapStruct target fields;
- deprecated and unchecked API usage.
The child POM declares Java 21 source/target properties, but the root compiler configuration uses ${maven.java.version}, currently 25. The effective build therefore compiles with --release 25.
Because the module has multiple main classes, always select one explicitly. For example:
.\mvnw.cmd -pl MicroserviceModule spring-boot:run "-Dspring-boot.run.main-class=modernWebApp.stockApp.StockApp"Equivalent main classes are:
basicWebApp.courseApp.CourseAppbasicWebApp.jewelleryApp.JewelleryAppmodernWebApp.stockApp.StockAppmodernWebApp.shoppingApp.ShoppingApp
Swagger UI is intended to be available at <context-path>/swagger-ui/index.html on each application's port. A successful compilation does not establish that every application starts; see the known issues below.
- The root aggregator POM declares application dependencies. Every child module therefore inherits web, JPA, AMQP, Batch, gRPC, AWS, Avro, PostgreSQL, H2, and other libraries whether it uses them or not.
- One JAR has four possible main classes, so its runtime identity and Spring Boot packaging target are ambiguous.
- Course config scans
microservice.basicWebApp.courseApp, but code lives underbasicWebApp.courseApp. - Shopping config scans
microservice.shoppingApp, but code lives undermodernWebApp.shoppingApp. Its properties file also contains none of thepostgres.*values consumed byDatabaseConfig. - Shopping requests
ShoppingApp.properties, while the resource is namedshoppingApp.properties. That case mismatch can fail in a packaged JAR or on a case-sensitive filesystem. aws.storage.s3andobservabilityAppare sibling packages, so none of the four application entry points discovers them with default component scanning.- Course persists H2 data beneath the user's home directory and uses
create-drop; this is unsuitable as a shared default. - There are no unit, slice, integration, context-load, or architecture tests.
- Configuration uses custom
spring.config.locationdefaults. Standardapplication.ymlplus profiles would be easier to override and operate. - Package names mix naming conventions and do not use a stable reverse-domain namespace.
Consolidate build conventions, configuration patterns, documentation, and reusable infrastructure. Keep the four runtime applications separate because they have different APIs, data stores, ports, and operational lifecycles. Combining them into one Spring context would create a modular monolith, not simplify a microservice suite.
The first safe implementation step is characterization testing. Do not move packages or split Maven artifacts until each application's context and important endpoints have a minimal automated test boundary.