I am working on a requirement that asks me to call a specific endpoint after a successful to get some data. We achieved that using a SNS topic posted to a SQS queue which in turn calls an endpoint. SNS -> SQS -> My Endpoint (Process Q Message) -> Calls External Endpoint to get data.
Now, we have found out that data is not available immediately after order is processed and now the requirement is to keep trying every 30 seconds for 5 times.
Is there any way we can achieve this?
Right now, I have made it such that My endpoint which process the message from Queue always returns an error so that the message is retried.
I have the visibility timeout set to 30 seconds so that the message is re-tried every 30 seconds for 5 times.
Is there a better way to achieve what I want with my existing setup? Please help.