Accepted
We need a robust, enterprise-grade service to consume messages from SQS, process financial transactions, and store them in DynamoDB. The service must handle high throughput, provide resilience patterns, and integrate well with AWS services. We need to choose between Java and Kotlin for the implementation.
We will use Spring Boot with Java for the consumer service with the following technology stack:
- Language: Java 21 (chosen over Kotlin for better team familiarity)
- Framework: Spring Boot 3.x
- AWS Integration: Spring Cloud AWS for SQS and DynamoDB
- Resilience: Resilience4j for circuit breaker and retry patterns
- Monitoring: Spring Boot Actuator with Micrometer for metrics
- Observability: OpenTelemetry for distributed tracing
- Testing: JUnit 5 with Spring Boot Test
- Mature Ecosystem: Well-established framework with extensive documentation
- AWS Integration: Excellent Spring Cloud AWS support for SQS and DynamoDB
- Enterprise Features: Built-in support for monitoring, health checks, and configuration
- Resilience Patterns: Circuit breaker, retry, and bulkhead patterns available
- Testing: Comprehensive testing framework and utilities
- Performance: High-performance JVM with optimized garbage collection
- Community: Large community and extensive third-party library support
- Memory Usage: Higher memory footprint compared to Kotlin
- Startup Time: Slower startup compared to compiled languages
- Complexity: More complex than lightweight frameworks
- Learning Curve: Steeper learning curve for new developers
- Resource Usage: Higher CPU and memory usage
- JVM: Platform independence but JVM overhead
- Type Safety: Strong typing but more verbose than some alternatives
- Dependency Management: Maven/Gradle dependency management
- Kotlin: Rejected due to team's better familiarity with Java
- Uses Spring Cloud AWS SQS listener with manual acknowledgment
- Circuit breaker and retry patterns implemented with Resilience4j
- Batch processing for improved throughput
- OpenTelemetry auto-instrumentation for observability
- Health checks and metrics exposed via Actuator endpoints
- Comprehensive test coverage with unit, integration, and E2E tests
- TestContainers for realistic integration testing with LocalStack