Skip to content

Switch to Jackson Jr #199

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

Open
sapessi opened this issue Oct 20, 2018 · 4 comments
Open

Switch to Jackson Jr #199

sapessi opened this issue Oct 20, 2018 · 4 comments
Assignees
Milestone

Comments

@sapessi
Copy link
Contributor

sapessi commented Oct 20, 2018

Remove heavy-weight ObjectMapper for common proxy events and switch to Jackson Jr

@sapessi sapessi self-assigned this Oct 20, 2018
@sapessi sapessi added this to the Release 1.2 milestone Oct 20, 2018
@sapessi
Copy link
Contributor Author

sapessi commented Oct 22, 2018

Turns out that moving to Jackson Jr is too big a breaking change for a minor release. The LambdaContainerHandler currently exposes a static method to get a system ObjectMapper. Removing this method would break backward compatibility. For the time being, I only added the afterburner module to the handler's object mapper.

@sapessi sapessi modified the milestones: Release 1.2, Release 2.0 Oct 22, 2018
@TuomasKiviaho
Copy link

TuomasKiviaho commented Apr 20, 2020

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;

I was trying to utilize LambdaContainerHandler for RequestHandler but noticed that these are required. Could these dependencies at least be extracted out so that the dependencies don't have to introduced for vain. An abstract base class that would not have objectReader/Writer, proxyStream would be enough and the LambdaContainerHandler would be extended from this base class preserving the backward compatibility.

This would also make it possible to leave s the requestClass, responseClass constructor params out from the base class thus simplifying thing a bit.

@sapessi
Copy link
Contributor Author

sapessi commented Apr 20, 2020

It is something we plan to do for a version 2.0. The challenge today is that the LambdaContainerHandler exposes a static method to get the object mapper and customers may rely on it. Removing the method is too big a breaking change for a minor release.

@deki deki modified the milestones: Release 2.0, Release 3.0 Jan 12, 2024
@deki
Copy link
Collaborator

deki commented Oct 25, 2024

Custom serialization is now available to use: https://docs.aws.amazon.com/lambda/latest/dg/java-custom-serialization.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants