2 Answers
- Newest
- Most votes
- Most comments
0
Hi, you need to post the message using the Api Gateway Management API, indicating the Connection Id where you need to send your message to and your API url. You can use the aws sdk to do this, you can use the postToConnection method in the AmazonApiGatewayManagementApiClient class. Please check
- https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/apigatewaymanagementapi/AmazonApiGatewayManagementApiClient.html
- Documentation of management API, includes an example using python, https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html
answered 2 months ago
0
Hi, You could enable 2-way communication on API Gateway websocket to send the response back to client. After 2-way communication is enabled,
- For proxy integrations, API Gateway automatically passes the backend output to the caller as the complete payload. There is no integration response.
- For non-proxy integrations, you must set up at least one integration response:
Kindly refer this doc for more details.
Additionally, you could also use "postToConnection" as explained in post, However this requires additional code to be written on the integration side to Post the message back to client
answered 2 months ago
Relevant content
- Accepted Answerasked 9 months ago
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago