Requirements implemented:
- Java 17+, Spring Boot 3.x WebFlux, PostgreSQL with R2DBC, Maven multi-module, Docker/Compose
- Event-driven, bounded concurrency with backpressure
- TCP/UDP log collection, enrichment via blacklist, forwarding to central server
- Storage and querying with filtering; metrics on collector and server
- Simulated Linux/Windows clients generating logs every 1–2s
mvn clean package -DskipTestsdocker-compose up --buildServices:
- Postgres:
postgres:5432 - Log Server API:
http://localhost:8080 - Log Collector: TCP
9000, UDP9001, Metricshttp://localhost:8090/metrics
- Ingest metrics:
curl http://localhost:8080/metricscurl http://localhost:8090/metricscurl http://localhost:8080/logs?is.blacklisted=true&limit=5curl http://localhost:8080/logs?service=windows-client&level=ERROR&username=Administrator&is.blacklisted=false&limit=20&sort=desccurl http://localhost:8080/logs?service=linux-client&level=INFO&username=root&limit=5- Query logs with filters:
curl "http://localhost:8080/logs?service=linux-client&level=INFO&username=root&blacklisted=false&limit=20&sort=desc"curl http://localhost:8080/logs?service=linux-client&limit=10- Reactive streams (Project Reactor) throughout
- Non-blocking TCP/UDP using Reactor Netty
- Bounded queues using
onBackpressureBufferwith limits - Controlled parallelism via Reactor schedulers (bounded)
- Graceful shutdown hooks close sockets and stop generators
Copy .env.example to .env to override defaults.
Run:
mvn testIncludes parsing/validation, blacklist enrichment, DB filter logic, and metrics unit tests.