A distributed asynchronous request processing framework optimized for AWS services.
The Async Processing Framework provides a robust, AWS-native solution for handling long-running operations with support for:
- Distributed Processing: Handle async operations across multiple instances
- AWS Native: Optimized for AWS services (DynamoDB, SQS, S3)
- State Management: Track multi-step API call completion using DynamoDB
- Storage Integration: Support both inline and S3-stored large payloads
- Retry Mechanisms: Built-in SQS polling and retry with exponential backoff
- Monitoring: Comprehensive CloudWatch metrics and health checks
- Spring Integration: Auto-configuration and seamless Spring Boot integration
Add the framework dependency to your pom.xml
:
<dependency>
<groupId>com.pravah.framework</groupId>
<artifactId>async-processing-framework</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Add configuration to your application.properties
:
# AWS Configuration
async.framework.aws.region=ap-south-1
async.framework.aws.dynamodb.table-name=async-requests
async.framework.aws.s3.bucket-name=async-payloads
# SQS Queue URLs
async.framework.aws.sqs.queue-urls.default=https://sqs.ap-south-1.amazonaws.com/123456789012/async-requests
async.framework.aws.sqs.queue-urls.retry=https://sqs.ap-south-1.amazonaws.com/123456789012/async-requests-retry
@Component
public class MyAsyncRequest extends AsyncRequest {
@Override
protected CompletableFuture<Boolean> executeAsync() {
// Your async processing logic here
return CompletableFuture.completedFuture(true);
}
@Override
public List<AsyncRequestAPI> getRequiredAPIs() {
return List.of(AsyncRequestAPI.EXTERNAL_API_CALL);
}
}
@Service
public class MyService {
@Autowired
private AsyncRequestBuilder asyncRequestBuilder;
public void processAsync(String payload) {
AsyncRequest request = asyncRequestBuilder
.withType(AsyncRequestType.CUSTOM)
.withAppId("my-app-123")
.withPayload(payload)
.build();
request.process();
}
}
The framework follows a layered architecture:
┌─────────────────────────────────────────┐
│ Client Applications │
├─────────────────────────────────────────┤
│ Framework API │
├─────────────────────────────────────────┤
│ Core Framework │
├─────────────────────────────────────────┤
│ AWS Abstraction │
├─────────────────────────────────────────┤
│ AWS Services │
└─────────────────────────────────────────┘
See the Configuration Guide for detailed configuration options.
mvn clean compile
mvn test
mvn verify
This project is licensed under the MIT License - see the LICENSE file for details.