Giter VIP home page Giter VIP logo

Comments (4)

PatrykGala avatar PatrykGala commented on September 15, 2024

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.

lucasam avatar lucasam commented on September 15, 2024

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.

carlzogh avatar carlzogh commented on September 15, 2024

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.

musketyr avatar musketyr commented on September 15, 2024

thanks, that looks correct!

from aws-lambda-java-libs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.