How aldrinm/micronaut-retryable-sample works
Project type and purpose
• This is a small Micronaut‐based backend service written in Java.
• It exposes HTTP endpoints (HelloController) and includes a declarative HTTP client (HelloClient) to call other services.
• Build, testing, and packaging are handled by Gradle (with Shadow plugin and optional GraalVM native image support).
File structure
• Top‐level build files: build.gradle.kts, gradle.properties, settings.gradle.kts, wrapper under gradle/wrapper, plus Micronaut CLI config.
• src/main/java/aldrinm:
• Application.java – boots the Micronaut context and HTTP server
• HelloController.java – defines REST endpoints
• HelloClient.java – a declarative HTTP client interface
• src/main/resources: configuration files (application.properties, logback.xml)
• src/test/java/aldrinm: HelloClientSpec.java – unit tests for the client
README for additional insights
• It points to Micronaut documentation and features: Jackson serialization, AOT, Shadow jar, GraalVM.
• No external database or frontend mentioned, so this is purely a backend microservice.
Main components
a. HTTP Client (external caller)
b. API Gateway / Micronaut HTTP Server
• HelloController
• Micronaut Core (IoC container, routing, serialization)
c. HelloClient (declarative HTTP client that calls downstream service)
d. Downstream External Service (could be another microservice or 3rd‐party API)
e. Configuration layer (application.properties)
f. Logging (Logback)
g. Build/Deployment Pipeline (Gradle → Shadow JAR → [optional GraalVM native image])
Relationships and interactions
• External client → HTTP → HelloController
• HelloController → in‐process call to HelloClient
• HelloClient → HTTP → Downstream External Service
• All components read configuration from application.properties
• Logging flows from controllers/clients to Logback sinks
• At build time: Gradle compiles code, packages with Shadow plugin, optionally builds native image via GraalVM plugin
Architectural patterns and design principles
• Microservice pattern: single‐responsibility service exposing HTTP API
• Dependency injection / Inversion of control (Micronaut IoC)
• Declarative HTTP client pattern (HelloClient)
• Twelve‐factor app principles: externalized config, structured logging