What is the simplest way to process WebSockets messages on AWS?

北战南征 提交于 2021-01-27 10:40:21

问题


What is a good way to deploy a WebSockets client on AWS?

I'm building an app on AWS which needs to subscribe to several WebSockets and several REST sources and process incoming messages (WebSockets) or make periodic requests (REST). I'm trying to go server-less and maximize use of AWS platform services, to eliminate the need to manage VMs, OS patches, etc. (and hopefully reduce cost).

My idea so far is to trigger a Lambda function every time a message arrives. The function can then transform/normalize the message and push it to an SQS queue for further processing by other subsystems.

There would be two types of such Lambda clients, one that subscribes to WebSockets messages and another that makes HTTP request periodically when invoked by a CloudWatch schedule. It would look something like this:

This approach seems reasonable for my REST clients, but I haven't been able to determine if it's possible to subscribe to WebSockets messages using Lambda. Lambdas can be triggered by IoT, and apparently IoT supports WebSockets now, but apparently only as a transport for the MQTT protocol:

AWS IoT Now Supports WebSockets, Custom Keepalive Intervals, and Enhanced Console

What is the best/easiest/cheapest way to deploy a WebSockets client without deploying an entire EC2 or Docker instance?

来源:https://stackoverflow.com/questions/38982603/what-is-the-simplest-way-to-process-websockets-messages-on-aws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!