- Newest
- Most votes
- Most comments
Regardless of the solution you eventually choose, you should take into consideration that connections can be closed. It can be by the server, like the case with API Gateway, ir it can be any other network issue that may cause the connection to break.
For this reason, the fact that API Gateway closes the connection every two hours should not be an issue. The client should recreate the connection when it detects that the connection is closed. Also, the server side should save messages in a database if currently there are no open connection to the client. When the connection is established, the server should check if there are any pending messages for that client.
Saying that, did you check the option of using IoT Core? It has a 24 hours connection limit and may be more appropriate for IoT use cases.
Given the description of the use case, I would consider using AWS IoT Core and not API Gateway as your backend. Not only AWS IoT Core provides MQTT over Secure Web Socket protocol with connections lasting 24hrs. MQTT client libraries normally manage the reconnection. You also get a fully managed, scalable and secure IoT service.
Relevant content
- asked 2 years ago
- asked 2 months ago
- asked 4 years ago
- asked 5 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Sure, a connection loss can always occur. We are not quite sure if a 2h automatically reconnect cycle time is something common and therefore would be accepted from our customers. But we will start with this. Thanks