Skip to main content

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; custom retryWithBackoff for 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
ClientRetryConditions
Azure client (retryWithBackoff)3 attempts, fixed 2000msOnly on 5xx errors
Raw axios calls (http.service.ts)NoneN/A

Queue Retry

Not applicable. This service does not consume queues.

Timeouts

CallTimeoutConfigured in
Raw axios callsNot set (infinite)axios defaults

Circuit Breakers

None. No circuit breaker library is configured or used.

Fallback Strategy

Failure scenarioBehaviourUser impact
Azure API returns 5xxRetries up to 3 times with 2s delayTransparent if retry succeeds
Azure API returns 4xx or network errorError logged and re-thrown immediatelyNLP processing fails
Other HTTP calls failError logged and re-thrownProcessing fails

Health Check

None. No health endpoint is exposed.

Known Gaps

  • Raw axios calls in http.service.ts have 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