Advanced Feature Pack
NioFlow includes multiple opt-in features designed for small teams operating production services without heavy platform infrastructure. These capabilities handle resilience, observability, and developer experience natively within the framework.
ChaosMiddleware
Controlled fault injection to simulate real-world networking issues and validate frontend resilience.
- Guarded by
NIOFLOW_CHAOS_ENABLED=true. - Logs each injected fault with route and path.
Per-route Observability
Granular protection and telemetry for individual endpoints using a fluent API.
- Per-route request/error counters and sliding p50/p95/p99 latency tracking.
- Route-scoped timeout and rate limit enforcement.
Request Hedging
Tail-latency reduction for critical reads by speculatively firing a backup execution.
- Fires a backup execution when primary crosses threshold (e.g., 100ms).
- Returns first successful completion to the client.
Circuit Breaker
Prevent cascading failures to downstream services with automatic fast-failing.
- CLOSED: requests flow normally.
- OPEN: requests are immediately rejected with
503andRetry-After. - HALF_OPEN: one trial request is allowed through to test recovery.
- v1.4.0 Improvement: Uses
AtomicReferencewith CAS transitions for absolute thread safety.
Request Replay
Fast debugging by replaying recent recorded requests through the current live pipeline.
- Guarded by
NIOFLOW_REPLAY_ENABLED=true. - v1.4.0 Security: Replay endpoints are now protected by
AuthMiddlewareby default. Access requires a valid JWT. - Sensitive headers (Auth, Cookies, API Keys) are stripped before storage.
Hot Reload
Near-instant developer feedback with automatic recompilation on file changes.
- Guarded by
NIOFLOW_WATCH=true. - Monitors source directory and restarts via child process.
NioFlow CLI (NPM)
A Node.js powered tool to scaffold, run, and manage Java projects with a modern developer experience.
- Zero-configuration scaffolding with Maven Wrapper integration.
- Single-command project execution and hot-reloading.
- Installable globally via
npm install -g @jhanvi857/nioflow-cli.