Hi
I'm trying here to solve the problem of guaranteed response to the specific service node with SQS intercommunication, maybe some of you can hint me with solution
Description:
Imagine we have an API Gateway service which is scaled with multiple nodes under a load balancer.
During the REST request from the front-end, one of the random API Gateway Node (AGN in future) is hit with GET request. To fulfil this request AGN needs to request additional information from one of the internal microservices. So AGN drops the request to the Q of the specific microservice and requires a response in return.
Obviously, whole intercommunication is stateless, all services are scaled and any random node of this microservice can read request from the Q.
However initial AGN still holds an active HTTP connection which requires a response so microservice will drop its response to the API getaway Q, where potentially any of API Gateway node can pick it up, but we require this response to be delivered to the specific node, which still has an active connection from the front-end and waiting for response.
See the attached diagram: https://www.screencast.com/t/H1B1eLJex
Question:
How do I guaranty that only a specific node will pick up the response message from the Q and not the other node? I would imagine just SQS is not enough, then what other AWS service can I use, to some sort of subscribe for response and get notified when data is ready to pick it up?
Edited by: VSBryksin on May 17, 2019 7:52 AM
Edited by: VSBryksin on May 17, 2019 7:52 AM