Open alicanguclukol opened 4 years ago
Hi,
EventBridge is a new service based on CloudWatch Events.
Does the CloudWatch scheduled event object meet your requirements?
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.
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.
@polaskj, Great suggestion, let me try that out.
Any news on this? I see that the PR has been open since January.
Any news about this?, can some help us merging the PR opened since January?
Hi @StFS, @javiortizmol,
This will go out either with v4 of the events library or soon after, customer interest is clear.
@msailes any ETA on when v4 of the events library will be released?
I ask again, is there any ETA on v4 of the events library?
Any news on this?
Any updates about v4 ?
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.
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!