Comments (4)
Workaround:
public class ConnectHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
private static final Logger LOG = LogManager.getLogger(ConnectHandler.class);
@Override
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
String connectionId = extractConnectionId(input);
LOG.info("connectionid: {}", connectionId);
return ApiGatewayResponse.ok(connectionId);
}
private String extractConnectionId(Map<String, Object> input) {
Map<String, Object> requestContext = (Map<String, Object>) input.get("requestContext");
return (String) requestContext.get("connectionId");
}
}
from aws-lambda-java-libs.
I believe this PR #92 fixes this issue.
A new class https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java is created to handle APIGatewayV2 parameters
Still not present at version 2.6.0. Needs to be built from sources
from aws-lambda-java-libs.
Hey @musketyr - support for API Gateway WebSocket API events was released in version 2.2.7
of the aws-lambda-java-events
library as APIGatewayV2ProxyRequest
and APIGatewayV2ProxyResponse
events.
The RequestContext
model you're looking for is defined here https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java#L215-L554
from aws-lambda-java-libs.
thanks, that looks correct!
from aws-lambda-java-libs.
Related Issues (20)
- SnapStart Support HOT 9
- Announcement: default branch renaming
- The field "records" in SQSEvent should be renamed to "Records" HOT 4
- Support Event Step Function HOT 1
- Log issues when using the Quarkus Java framework HOT 6
- Environment variable different when SnapStart is enabled HOT 6
- Simulate AWS runtime environment for lambda in local run. HOT 3
- KinesisEvent not parsed correctly HOT 2
- Incomplete and/or missing API Gateway Lambda Authorizer events HOT 5
- RequestStreamHandler not working as expect HOT 2
- AWS lamba core reactive types HOT 2
- EventLoader unable to correctly deserialize posted json body data for APIGateway events HOT 2
- Failed to serialize CognitoUserPoolPreTokenGenerationEvent HOT 7
- Support VPC Lattice event structure
- APIGatewayProxyRequestEvent$RequestIdentity missing "cognitoAmr" field HOT 2
- Unable to upgrade with newer Jackson - conflicting `com.fasterxml.jackson.annotation.JsonFormat` HOT 5
- SNSEvent Jackson mixins are Incomplete HOT 6
- Failed to deserialize DynamodbEvent.DynamodbStreamRecord#dynamodb HOT 6
- Support v2 of Pre Token Generation Lambda HOT 1
- AWS documentation says LambdaLogger will default to the INFO log level, but it is actually defaulting to UNDEFINED HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-lambda-java-libs.