Exception when triggering Lambda based API from Cloudwatch Events

Đang mở
#368 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
aws, java, spring-boot
Lĩnh vực
api, backend, cloud

Hướng nghiên cứu

Bắt đầu với lỗi giải tuần tự hóa HttpApiV2ProxyRequest đã được ghi nhận và so sánh payload của sự kiện AWS CloudWatch được lập lịch với cấu trúc request mà tích hợp Java Spring Boot Lambda mong đợi. Được xem là hoàn tất khi một lần gọi được lập lịch không còn gây ra exception đã báo cáo và hành vi API dự kiến diễn ra.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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]
Ngôn ngữ chính
Java
Star
1.6k
Fork
575
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/serverless-java-container

Tất cả issue của aws/serverless-java-container

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.