Resilience: hbf-nlp
Error handling and retry patterns for this service. Platform-wide patterns:
docs/architecture/resilience.md
HTTP Retry
- Library: axios (direct usage in
http.service.ts; customretryWithBackofffor Azure) - Attempts: 3 (Azure client only); 1 for all other calls (no retry)
- Backoff: Fixed 2000ms delay (Azure client only)
- On failure: Error logged and re-thrown; exception handler maps status codes to
HttpException
| Client | Retry | Conditions |
|---|---|---|
Azure client (retryWithBackoff) | 3 attempts, fixed 2000ms | Only on 5xx errors |
Raw axios calls (http.service.ts) | None | N/A |
Queue Retry
Not applicable. This service does not consume queues.
Timeouts
| Call | Timeout | Configured in |
|---|---|---|
| Raw axios calls | Not set (infinite) | axios defaults |
Circuit Breakers
None. No circuit breaker library is configured or used.
Fallback Strategy
| Failure scenario | Behaviour | User impact |
|---|---|---|
| Azure API returns 5xx | Retries up to 3 times with 2s delay | Transparent if retry succeeds |
| Azure API returns 4xx or network error | Error logged and re-thrown immediately | NLP processing fails |
| Other HTTP calls fail | Error logged and re-thrown | Processing fails |
Health Check
None. No health endpoint is exposed.
Known Gaps
- Raw axios calls in
http.service.tshave no retry logic - No HTTP timeout on most calls (could hang indefinitely)
- Azure client retries only on 5xx, not on network errors (connection refused, DNS failure, etc.)
- No health endpoint
- No circuit breaker on any dependency