Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plan to add EventBridge event? #109

Open
alicanguclukol opened this issue Apr 7, 2020 · 13 comments
Open

Any plan to add EventBridge event? #109

alicanguclukol opened this issue Apr 7, 2020 · 13 comments
Labels
events-v4 To be pulled into aws-lambda-java-event v4

Comments

@alicanguclukol
Copy link

Hi there.

I'm using a lambda function to process events from an event bus.

I'm not able to find out which is the runtime event class to access these events.
There does not seem to be any EventBridge* class in the following link:

https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events

I think a class extending com.amazonaws.services.eventbridge.model.PutEventsRequestEntry may do the work.
Do you have any plan to add something like that?

Thanks!

@msailes
Copy link
Collaborator

msailes commented Sep 30, 2020

Hi,

EventBridge is a new service based on CloudWatch Events.

Does the CloudWatch scheduled event object meet your requirements?

https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ScheduledEvent.java

@nanodeath
Copy link

Unfortunately if you drop in ScheduledEvent instead, you get this:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "version" (class com.amazonaws.services.lambda.runtime.events.ScheduledEvent), not marked as ignorable (8 known properties: "detail", "region", "resources", "detailType", "account", "source", "time", "id"])

If you deserialize the object yourself, using Jackson, and add this:

.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)

it seems to work well enough. Not ideal though.

@msailes
Copy link
Collaborator

msailes commented Jan 6, 2022

Hi @nanodeath,

I'll add support for EventBridge events after v4 has been released.

Thanks,

Mark

@polaskj
Copy link

polaskj commented Jan 12, 2022

Going to offer a suggestion since this is still open to being implemented. I've seen many uses of Object rather than strongly typing fields (as an example detail in ScheduledEvent). This leaves the rest of the deserializing efforts up to the caller and can be error-prone.

I'd like to see something more along the lines of this, so a caller-provided generic can represent the detail, instead of just Object

public class EventBridgeEvent<T extends EventBridgeDetail> implements Serializable, Cloneable {
    ....
    private T detail;

Eg callsite:

public Context handleRequest(EventBridgeEvent<EventBridgeS3EventDetail> event, Context context) {
...
return context;
}

I'd be happy to continue the discussion on this.

@msailes
Copy link
Collaborator

msailes commented Jan 12, 2022

@polaskj, Great suggestion, let me try that out.

@StFS
Copy link

StFS commented Mar 23, 2022

Any news on this? I see that the PR has been open since January.

@javiortizmol
Copy link

Any news about this?, can some help us merging the PR opened since January?

@msailes
Copy link
Collaborator

msailes commented Apr 20, 2022

Hi @StFS, @javiortizmol,

This will go out either with v4 of the events library or soon after, customer interest is clear.

@msailes msailes added the events-v4 To be pulled into aws-lambda-java-event v4 label May 12, 2022
@StFS
Copy link

StFS commented Sep 28, 2022

@msailes any ETA on when v4 of the events library will be released?

@StFS
Copy link

StFS commented Dec 13, 2022

I ask again, is there any ETA on v4 of the events library?

@einarjohnson
Copy link

Any news on this?

@evgromva
Copy link

Any updates about v4 ?

@msailes
Copy link
Collaborator

msailes commented Feb 1, 2023

I don’t currently have a date we can share. The team is aware of the difficulties this causes and are working to improve the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events-v4 To be pulled into aws-lambda-java-event v4
Projects
None yet
Development

No branches or pull requests

8 participants