Exception when triggering Lambda based API from Cloudwatch Events

Aperta
#368 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
aws, java, spring-boot
Ambito
api, backend, cloud

Direzione di ricerca

Inizia dal fallimento di deserializzazione registrato di HttpApiV2ProxyRequest e confronta il payload dell’evento AWS CloudWatch pianificato con la struttura della request prevista dall’integrazione Java Spring Boot Lambda. Il lavoro è completato quando un’invocazione pianificata non genera più l’eccezione segnalata e si verifica il comportamento previsto dell’API.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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]
Lingua principale
Java
Stelle
1.6k
Fork
575
Merge medio
1g 15h
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/serverless-java-container

Tutte le issue di aws/serverless-java-container

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.