-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force disconnecting an API Gateway WebSocket through Lambda #377
Comments
Likewise, how can I send a packet to a specific WebSocket if I store that connectionId in DynamoDB? I'm basically wondering what the object is to create/recreate a WebSocket into a usable form from any Lambda given a connectionId, and haven't found any obvious way to do that. All I've found is this reference https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html for accessing the connections, but it doesn't look convenient to work with. |
Amazon API Gateway's WebSocket support is event driven in design. It will send events on Connect, Disconnect and Message. You must manage the connections and who it is connected to the other end. When you implement the Connect handler you will probably save a business id with the connection id. Then when you want to send a message to a specific entity, you can find the connection id from that id. You then invoke the API Gateway management API to send a message to a specific connection id. This is an example you might find helpful. |
That reference is helpful, but I'm looking for a Java solution to manage the API Gateway WebSockets. Not sure how to do that - I was able to find some help via AmazonApiGatewayManagementApi, but seems to have an issue with Quarkus GraalVM build-native. |
I'm using the WebSocket Protocol for API Gateway to route Client requests to specific Lambda invocations. How can I use Lambda to close a WebSocket?
Example:
The text was updated successfully, but these errors were encountered: