简体   繁体   English

如何在 lambda function 中为 Springboot CRUD 应用程序构建请求处理程序 class?

[英]How to build request handler class in lambda function for a Springboot CRUD Application?

I am trying to invoke a lambda function by the new feature - function URL"S https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html using which I don't require any trigger events.我正在尝试通过新功能调用 lambda function - function URL"S https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html使用它我不需要任何触发事件.

I am able to get the output for a simple java application using the above approach written in documentation by using Java as runtimeEnvironment and passing Jar file from my local machine.通过使用 Java 作为 runtimeEnvironment 并从我的本地计算机传递 Jar 文件,我能够使用文档中编写的上述方法为简单的 java 应用程序获取 output。

Now, I want to test lambda functionality by same concept but for Springboot-Application which has restful endpoints for GET,POST,PUT,DELETE for different crud operations connecting with MySql db.现在,我想通过相同的概念测试 lambda 的功能,但对于 Springboot 应用程序,它具有用于与 MySql db 连接的不同 crud 操作的 GET、POST、PUT、DELETE 的 restful 端点。 The problem I am facing is how to tell handler class that to route to these endpoints and trigger lambda functions.我面临的问题是如何告诉处理程序 class 路由到这些端点并触发 lambda 函数。

Any help/suggestions appreciated here.任何帮助/建议在这里表示赞赏。 Thanks in Advance !提前致谢 !

It probably won't work with this URL's feature but it allows handle Lambda events similar to standard Spring web requests.它可能不适用于此 URL 的功能,但它允许处理类似于标准 Spring web 请求的 Lambda 事件。

You can check this one: https://github.com/MelonProjectCom/lambda-http-router你可以查看这个: https://github.com/MelonProjectCom/lambda-http-router

Example usage:用法示例:

    @PathPostMapping("/example/test")
    public String example(@Body String body) {
        return "Hello World! - body: " + body;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Springboot、Micrometer 和 Aws Lambda function - Springboot, Micrometer and Aws Lambda function 如何重命名 python 脚本以用于 lambda - lambda_handler vs main() function 名称? - how to rename python script to be used in lambda - lambda_handler vs main() function name? 如何从私有 VPC 中的 lambda function 发出 https 请求? - How to make https request from a lambda function which is in a private VPC? AWS Golang Lambda 处理程序 function 未被调用 - AWS Golang Lambda handler function not getting called 如何在 Android 和 AWS Lambda 之间共享请求/响应 class - How to share Request/Respons class between Android and AWS Lambda 对 AWS lambda 函数的 curl 请求没有收到 json - curl request to AWS lambda function receives no json 如何构建、package 和部署 AWS SAM lambda function 从 azure Devops CI/CD 管道到 AWS - how to build, package and deploy AWS SAM lambda function of python from azure Devops CI/CD pipeline to AWS 如何在 Lambda 处理程序中处理多个异步函数? - How to handle multiple async functions in a Lambda handler? 测试时 index.handler 未定义或未导出 Lambda function - index.handler is undefined or not exported when testing Lambda function AWS Axios 请求中的 NodeMailer Lambda function - NodeMailer inside of Axios request on a AWS Lambda function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM