user2894233
user2894233

Reputation: 31

Retry and fallback solution in Spring cloud function on AWS Lambda when calling external API

Need solution for the scenario I’ve in hand A) There is a spring boot service which on creation of data publishes an event(message payload) to the Kafka Topic B) There is a Spring cloud function on AWS lambda which listens to this topic and consumes the message (although not yet figured out whether to use Spring cloud function or Lambda function - need suggestion in decision making) C) This cloud function then calls an external Rest API, which is outside of AWS. Need to implement the solution for retry logic in Spring Cloud function in case the external Rest API does not respond back/fails. I followed this article below which suggests to use step functions for retry with backoff pattern implementation , is there any sample code for the same and what should be the cost considerations to keep in mind while using these services • https://dzone.com/articles/using-aws-step-functions-for-offloading-exponentia

Also, do we really need to implement the AWS step functions or is there any solution for retry logic in Spring Cloud function

I followed this article below which suggests to use step functions for retry with backoff pattern implementation , is there any sample code for the same and what should be the cost considerations to keep in mind while using these services • https://dzone.com/articles/using-aws-step-functions-for-offloading-exponentia

Upvotes: 0

Views: 128

Answers (1)

csharma
csharma

Reputation: 1

Can we use spring retry in the lambda function with exponential back-off for any intermittent issue while calling the external api for example in case of internal server error, network error etc.

Exponential back-off because instead of retrying after waiting for a fixed amount of time, we increase the waiting time between retries after each retry failure.

And if even after retry we are still getting the error in this case we can think of using ops center to created the ops ticket for manual remediation.

Upvotes: 0

Related Questions