You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this issue has been open for so long. Reading your message here, it seems to me that you are trying to get something equivalent to Spring's WebSocketSession — a live connection object you can pass to WebSocketHandler functions and call sendMessage() on directly. Is that correct?
If so, that's not possible in Lambda. API Gateway owns the WebSocket connection, and Lambda is invoked statelessly per message. There's no persistent server-side socket to wrap in a session object. To send messages back to a connected client, you use the API Gateway Management API with the connectionId from event.getRequestContext().getConnectionId().
If you had something else in mind, let me know and I can reopen this.
Activity
darklight3it commentedon May 26, 2026
Hello @kondavivek,
Sorry if this issue has been open for so long. Reading your message here, it seems to me that you are trying to get something equivalent to Spring's
WebSocketSession— a live connection object you can pass toWebSocketHandlerfunctions and callsendMessage()on directly. Is that correct?If so, that's not possible in Lambda. API Gateway owns the WebSocket connection, and Lambda is invoked statelessly per message. There's no persistent server-side socket to wrap in a session object. To send messages back to a connected client, you use the API Gateway Management API with the
connectionIdfromevent.getRequestContext().getConnectionId().If you had something else in mind, let me know and I can reopen this.