2

I am creating an application with nodejs based on KCL. in the processRecords function, I tried to send the records which I get from kinesis to the web service with http request. But when the web service is not available, the http request will be failed. I want to KCL stop to get records from kinesis and send an alert to pagerduty.

Anyone knows how to do it?

Angle Tom
  • 1,060
  • 1
  • 11
  • 29

1 Answers1

1

Providing this more as a general strategy instead of specific code:

In case you aren't already, make sure you've setup a good retry policy with exponential backoff in case of errors - this will handle most temporary problems.

In your case, you probably want a 'retry forever' type policy, and fire off your pagerduty alert when the number of retries crosses some threshold you define (ie: numRetries==30 or something).

Krease
  • 15,805
  • 8
  • 54
  • 86