How jonathanmdr/resilience-http-client works
Main Components
• Order API Service:
• Found under the “order-api” directory.
• Exposes REST endpoints (via OrderController) for order operations and integrates with the authorization service (HTTP client integration, as shown in its “autorization/integration” packages).
• Contains controllers, persistence (via JPA repositories), use case configurations, and integration messaging for event publishing.
• Authorization API Service:
• Located under “authorization-api”.
• Provides endpoints for handling authorization requests (for both orders and feature toggling).
• Manages authorization persistence and includes exception handling, configuration (OpenAPI, logging, object mapper), and validation.
• Order Worker:
• Located in the “order-worker” module.
• Responsible for background processing—consuming and processing events related to order and authorization updates.
• Contains both order and authorization components including consumers (e.g., AuthorizationProcessedConsumer, AuthorizationProcessedDltConsumer) and access to persistence layers.
• Core Domain Module:
• Located in “domain”.
• Encapsulates core business logic, DDD patterns, domain events, entities, validation, and exception handling.
• Its concepts (such as Order, Authorization, Domain Events, Validators) are reused across APIs and the worker.
• Application Layer:
• Found in “application” (and related packages in each module).
• Contains the business use cases and input/output models that orchestrate interactions between the presentation/API layers and the domain layer.
• Infrastructure / Configurations:
• Migrations (under .migrations) for database schema setups for different domains (ecommerce, authorizations).
• Dockerfile, docker-compose.yaml, and Makefile which indicate containerized deployment and orchestration.
• .otel-dev directory and README details show inclusion of OpenTelemetry for observability and monitoring.
External and Supporting Systems
• Messaging System:
• Observability & Telemetry:
• OpenTelemetry components (agent, collector configurations) as external monitoring setups.
• Other tools such as Prometheus, Grafana, Jaeger (with ports mentioned in README) should be shown as external systems capturing metrics, logs, and traces.
• Databases:
• Although not explicitly named as “database”, the migrations and JPA-related packages indicate persistence layers. Create a generic “Database” component attached to each microservice where applicable.
Interactions and Dependencies
• That the Order Worker consumes messages/events (from Kafka) published either by the Order API or from internal event processing.
• That all services leverage a shared Domain layer, which serves as the core business logic provider.
Architectural Patterns and Design Principles
• DDD (Domain-Driven Design): The separation of domain, application, and infrastructure layers.
• API Gateway / Microservices Pattern: Different services (order-api, authorization-api, order-worker) work together through clear REST interfaces and messaging integrations.
• Resilience Patterns: While not all specific resilience mechanisms are drawn out in code, indications (such as “DefaultAuthorizeOrderUseCase” and explicit integration components) suggest use of fallback, retries, and circuit-breakers.
• Kafka as the messaging backbone between order-api and order-worker.
• Finally, include side panels or notes for development tools (docker-compose, Makefile) that hint at how the environment is managed and deployed.