aws / aws/serverless-java-container

Exception when triggering Lambda based API from Cloudwatch Events

未关闭
#368 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
1.6k
派生
574
PR 合并指标
30 天内没有已合并 PR

描述

*To help us debug your issue fill in the basic information below using the options provided*

*Serverless Java Container version*: `1.5.1`

*Implementations:* `Spring Boot 2`

*Framework version:* `SpringBoot 2.2.6.RELEASE`

*Frontend service:* `AWS Cloudwatch Events`

*Deployment method:* `Console`

## Scenario
I'm trying to schedule a trigger for an API which I have written in Java and deployed in Lambda. Another purpose of this to avoid the cold start as I'm not using provisioned concurrency for my Lambda.
I'm not sure what event to pass so that my API gets triggered properly

## Expected behavior
I expect the API endpoint to be hit at a specific time and it should do what is implemented

## Actual behavior
Since I don't know what even to pass to my trigger so I'm gettings exceptions in my lambda cloudwatch logs

## Steps to reproduce
No code sample required, just create any Java-based Spring boot API on lambda and attach a scheduled cloudwatch event to it.
It will give exceptions in the cloudwatch logs.

## Full log output

```
2020-07-22 18:17:04.935 ERROR 1 --- [ main] c.a.s.proxy.AwsProxyExceptionHandler : Called exception handler for:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" (class com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest), not marked as ignorable (12 known properties: "requestContext", "rawQueryString", "body", "queryStringParameters", "isBase64Encoded", "routeKey", "version", "stageVariables", "rawPath", "cookies", "headers", "pathParameters"])
at [Source: (lambdainternal.util.NativeMemoryAsInputStream); line: 1, column: 22] (through reference chain: com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest["id"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[task/:na]
```

贡献指南

打开贡献指南

调研方向

Start with the logged HttpApiV2ProxyRequest deserialization failure and compare the scheduled AWS CloudWatch Events payload with the request shape expected by the Java Spring Boot Lambda integration. Done means a scheduled invocation no longer raises the reported exception and the intended API behavior occurs.

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, java, spring-boot
领域
api, backend, cloud
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。