forge-health-aws provides health checks for use with AWS services such as S3, DynamoDb.
It distinguishes between liveness and readiness and supports dependency-aware checks.
This is the only module that is not vendor-agnostic and relies on AWS SDK.
forge-health-aws provides abstract base classes for health checks. To use them, create @Produces methods that return health check instances:
@Produces
@Readiness
@ApplicationScoped
public HealthCheck databaseHealthCheck(EntityManager entityManager) {
return new PostgresHealthCheck(
entityManager,
"mydb", // Database name
List.of("users", "orders") // Tables to check
) {};
}
@Produces
@Readiness
@ApplicationScoped
public HealthCheck dynamoDbHealthCheck(DynamoDbClient dynamoDbClient) {
return new DynamoDbHealthCheck(
dynamoDbClient,
List.of("Users", "Orders") // Tables to check
) {};
}
@Produces
@Readiness
@ApplicationScoped
public HealthCheck s3HealthCheck(S3Client s3Client) {
return new S3HealthCheck(
s3Client,
List.of("my-bucket", "backup-bucket") // Buckets to check
) {};
}
@Produces
@Readiness
@ApplicationScoped
public HealthCheck cognitoHealthCheck(CognitoIdentityProviderClient cognitoClient) {
return new CognitoHealthCheck(
cognitoClient,
"us-east-1_ABC123", // User Pool ID
"MyUserPool" // User Pool name
) {};
}
Once registered, health checks are automatically available at:
/q/health/ready - Readiness checks (includes all @Readiness checks)/q/health/live - Liveness checksSee: examples/forge-health-aws
Code examples demonstrate:
@Produces and @Readiness annotations