This project implements a complete feedback loop for autonomous system remediation using Java, Spring Boot, Kafka, Redis, and PostgreSQL.
- Docker & Docker Compose
- Java 17+
- Maven
docker-compose up -dThis starts:
- Kafka: Event backbone
- Redis: Rate limiting & cooldowns
- PostgreSQL: Policy storage
- Prometheus: Metrics collection
- Grafana: Visualization (Admin:admin)
Run each service in a separate terminal:
# Terminal 1
cd service-node && mvn spring-boot:run
# Terminal 2
cd anomaly-detector && mvn spring-boot:run
# Terminal 3
cd decision-engine && mvn spring-boot:run
# Terminal 4
cd action-executor && mvn spring-boot:runCall this multiple times to trigger the anomaly:
curl "http://localhost:8081/debug/memory-leak?megabytes=200"Expectation: anomaly-detector sees the memory jump, decision-engine picks the RESTART_SERVICE policy, and action-executor logs the execution.
curl "http://localhost:8081/debug/thread-exhaustion?seconds=60"Expectation: The 10-thread pool in the service becomes saturated, thread_count spikes, and the loop triggers.
curl "http://localhost:8081/debug/cpu-spike?seconds=30"- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (Admin:admin)
- Concurrency:
ThreadPoolExecutorfor action isolation;ConcurrentHashMapfor local state;Redisfor distributed locks. - Messaging: Kafka topics for
raw-metrics,system-alerts, andhealing-decisions. - Fault Tolerance: Idempotency via
ActionID(simulated) and Redis-based cooldowns.