Kinda new to AWS. I have this high level question. I’m looking for some insights about the general architecture and workflow, without the need to get into details.
So: I need a React app on the client, which calls AWS. In turn, on the server some code will send a queue message to some third party to perform some action. While waiting on a response, the react app will show status updates , meaning the different stages of the operation taking place on the server. When all is done, it’ll show a response.
SO that’s how I’d build it: React calls API gateway, which in turn calls a Lamba function, which then calls SQS and sends a message on some queue. But what Im not sure about is:
- How would the Lambda wait for the response? Is it a 2-way queue, is Lambda keep polling it until there’s an answer and then returns it to the client, or would there be two Lambdas. One that sends a queue and the other triggered by a response…? And if it’s a second Lambda, how would the React query it? Would there be some sort of Id when sending, and the third party returns a queue message when tis done with that Id that we can match them, or…? What would trigger that 2nd Lamba (if we’re doing two lambdas) a message arriving in queue would be the trigger, or would it keep polling, or…?
- How would the React client update the message? Keep polling some API? A different API than the one sent? Would I need websockets to show status updates, or something like RXJS or…? Would it be all about querying some API over HTTP (with Axios or Fetch API or whatever) or would it be some NPM package that queries a queue, in which case I might not even need Lambda checking for a return message, like Amplify from aws-amplify..?
Would appreciate any sort of knowledge answer. Again, just the high level architectureflow details. The rest I’ll figure out on my own.
Thanks!