1 Answer
- Newest
- Most votes
- Most comments
0
If you call the postToConnection API multiple times, there is not guarantee that the messages will get to the client in the same order. If order is important, do not send the second message until you get an ack on the first message.
Relevant content
- asked 10 months ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
Thanks, but i was not thinking about postToConnection api, but more the integration reponse from ApiGateway. Maybe it uses same api in background?
Sorry, my bad. I thought you were referring to messages send by the backend.
If you get two messages and send these messages to the integration for processing, and they return a response, which API GW should send back to the client, you have no control in which order the client messages will be processed, so you don't know in which order the responses will arrive back to API Gateway.
Bottom line, you can't rely on message ordering for the responses.