Preferred request handler interface to implement AWS Lambda

Viewed 438

I am writing an AWS lambda in Java. Lambda provides two interfaces to implement the request handler.

  1. RequestHandler - Uses lambda’s serialization for converting input request to InputPojo and vice versa for output.
  2. RequestStreamHandler – Implementor writes serialization-deserialization logic on input/output stream.

I could not find documentation on serialization behavior of Lambda. I am not sure of questions like

  • Will the serde ignore unknown properties?
  • Will the serde ignore null fields?
  • How to i specify names of json fields
  • Can the above behavior change in future?

I wanted to use Jackson annotations to have more control on this. But the documentation specifically states “You shouldn't rely on any other features of serialization frameworks such as annotations..“ So I am planning to use the second interface.

Before proceeding, given all above, want to check the recommended interface to use? which to use when?

Thanks

0 Answers
Related