[英]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.