简体   繁体   English

Quarkus 是否在一个项目中支持多个 AWS Lambda 处理程序?

[英]Does Quarkus support multiple AWS Lambda handlers in one project?

I've found several nice examples of Quarkus projects which enable easy declaration of Lambdas in a project, usually also using AWS SAM, which is great.我发现了几个很好的 Quarkus 项目示例,它们可以在项目中轻松声明 Lambda,通常也使用 AWS SAM,这很棒。 However, none of them (or any docs, that I could find) show support for multiple Lambda handlers in one project without having to choose a single Lambda to deploy.但是,它们(或我能找到的任何文档)都没有显示在一个项目中支持多个 Lambda 处理程序,而无需选择单个 Lambda 进行部署。

The use case I'm looking for is a basic REST API offering CRUD methods (one handler per HTTP verb) where the SAM template declares a new Lambda for each handler. The use case I'm looking for is a basic REST API offering CRUD methods (one handler per HTTP verb) where the SAM template declares a new Lambda for each handler.

Is this really not supported yet by a Quarkus library/extension, or is documentation just ambiguous about it? Quarkus 库/扩展是否真的不支持这一点,或者文档只是模棱两可?

This is not a definitive answer but as far as I know, quarkus will make you choose a single lambda handler for a build.这不是一个明确的答案,但据我所知,quarkus 会让您选择一个 lambda 处理程序进行构建。

For your use case though, you can simply create a single quarkus application with multiple jax-rs endpoints offering the required CRUD methods, and then use the quarkus extension "quarkus-amazon-lambda-http" (for deploying as AWS API Gateway HTTP api) or "quarkus-amazon-lambda-rest" (for deploying as AWS API Gateway REST api) for building your application which will allow quarkus to generate the required SAM template for API Gateway to invoke the corresponding jax-rs endpoint (as a new lambda invocation) per HTTP path and verb.但是,对于您的用例,您可以简单地创建一个具有多个 jax-rs 端点的单个 quarkus 应用程序,提供所需的 CRUD 方法,然后使用 quarkus 扩展“quarkus-amazon-lambda-http”(用于部署为 AWS API Gateway HTTP api ) or "quarkus-amazon-lambda-rest" (for deploying as AWS API Gateway REST api) for building your application which will allow quarkus to generate the required SAM template for API Gateway to invoke the corresponding jax-rs endpoint (as a new lambda 调用)每个 HTTP 路径和动词。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM