-
Notifications
You must be signed in to change notification settings - Fork 231
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
v4 Events Lib - Major Version Change #282
Comments
I'm not entirely aware on how the internals work right now. In my experiments around cold start performance I have always opted to use Jackson-jr instead of regular Jackson since it positively impacts the cold start. Now I use this, but internally ofcourse jackson regular is still being used so it's a double hit on performance. Will this change make it possible to have internal serialization also leverage faster frameworks and be replace the current (slower) Jackson lib? |
For a sample SQS event such as: {
"Records": [
{
"messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78",
"receiptHandle": "MessageReceiptHandle",
"body": "Hello from SQS!",
"attributes": {
"ApproximateReceiveCount": "1",
"SentTimestamp": "1523232000000",
"SenderId": "123456789012",
"ApproximateFirstReceiveTimestamp": "1523232000001"
},
"messageAttributes": {},
"md5OfBody": "{{{md5_of_body}}}",
"eventSource": "aws:sqs",
"eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:MyQueue",
"awsRegion": "us-east-1"
}
]
} I assume it Is currently working because you are using Jackson with mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); If records is always public class SQSEvent implements Serializable, Cloneable {
private static final long serialVersionUID = -5663700178408796225L;
private List<SQSMessage> records; with: public class SQSEvent implements Serializable, Cloneable {
private static final long serialVersionUID = -5663700178408796225L;
@JsonProperty("Records")
private List<SQSMessage> records; We should not need to support case insensitive properties. |
Please no lombok 🤢🤮 |
@graemerocher What would you prefer? |
There is a good reason not to use lombok in libraries -> no source code compatibility, your decompiled Java code won't be compatible with the source code and IDEA would light red like Christmas lights, so probably that's better to generate getters\setters via IDEA manually from my point of view, but hell thats so much boiler plate for such library (lombok is ok in libs thats provides DTO from my point of view) But when we are talking about library which whole purpose is to provide some kind of DTO, thats became debatable, standartization across whole code base (all lombok or all manual) from this stand point is good I also thing that it's better to replace Lombok @builder with just @Setter & @accessors(chain = true) (if we are talking about Lombok) |
What's the ETA on this ? |
@msailes ? |
There is no ETA currently. |
@msailes , can you create a Milestone and group all the pending issues so we can also help? |
Can v4 have Java 11 as baseline ? |
Is there any branch with v4? So we can make contributions |
I can see lots of the events implementing |
Is there any ETA on this one ? |
There are several issues for AWS Lambda Events which are problematic: A) No JSON Schema. |
Any expected release date for v4 ? |
If you roll out this library to public, please do so responsibly. There is completely no justification of Lombok scrambling bytecode and all our stacktraces. Also, if this is future-proof is up to debate. Not having schemas is the real problem though, as @sdelamo has pointed out. Is it upper case? lower case? required? optional? who knows? |
please can v4 support JPMS by including a |
2024 - any closer to an eta? If looking for elimination of boiler plate pojo getter/setters you could use java's new Record classes. Much preferred over lombok |
What would be great is if we had support for kotlinx.serialization |
The next major version of the
aws-lambda-java-events
library is now being worked on. As part of this we are considering changes around serialization. Our goals are to make it easier for customers to handle different serialization scenarios, reduce package size and to more easily add new events to the library.Our current plans include enabling customers to bring their own serializer by implementing the PojoSerializer interface and including a provider-configuration file under
META-INF/services
.To make it easier for new event objects to be added we are exploring ways to remove the use of mixins in the serialization library.
For example the SecretsManagerRotationEvent uses the SecretsManagerRotationEventMixin.java to change upper case attributes
Step
,SecretId
andClientRequestToken
to lower case ones. This is required because Jackson expects lower case attribute names. Instead Jackson annotations will be added directly to the event fields which require them.At this time we’ll also change the existing event objects to all follow the same design. Lombok annotations
@Data
,@NoArgsConstructor
,@Builder(setterPrefix = "with")
,@AllArgsConstructor
and@Singular
(when needed) will be added to events without them.The
joda-time
dependency will be removed in this release.The text was updated successfully, but these errors were encountered: