Built in protection
Hemera has some important built in protection capabilities:
- Process policy: Will cancel the incoming request and return an error when the policy (memory, event loop) could not be fullfilled (Option:
heavy
). - Message loop detection: Will cancel the request and return an error if you call a route recursively (Option:
maxRecursion
). - Auto-pruning: NATS automatically handles a slow consumer and cut it off. You are responsible to use a process-manager.
- Safe default JSON serializer: Provides a deterministic ("stable") version and will also gracefully handle circular structures. For more information see fast-safe-stringify package.
Circuit breaker
A circuit breaker is an important mechanism to provide stability and prevent cascading failures in distributed systems. We don't implement it in the core but the community provide great plugins which work very well with hemera.