aws / aws/aws-lambda-java-libs

Joda-time as required dependency for REST API implementations with AWS Lambda

未关闭
#72 3 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看
events-v4
主要语言
Java
星标
548
派生
241
平均合并
2 天 5 分钟
30 天内合并 PR
11

描述

Tried excluding Joda-time from a function's implementation for AWS Lambda and got next error:
```
java.lang.ClassNotFoundException: org.joda.time.DateTime: lambdainternal.util.ReflectUtil$ReflectException
lambdainternal.util.ReflectUtil$ReflectException: java.lang.ClassNotFoundException: org.joda.time.DateTime
Caused by: java.lang.ClassNotFoundException: org.joda.time.DateTime
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
```
This required dependency adds extra 0.5 megabytes to the resulting "fat jar". Extra jar size requires reserving more memory for the function to prevent Metaspace issues. But Joda-time itself is not of much use while using Java 8 (and earlier Java versions are not supported in AWS Lambda anyway), so this limitation is unnecessary.

Maybe it's time to get rid of Joda-time? At least in some "next gen" version, for example?

P.S.: Maybe it's a duplicate of #35 , but I just wanted to bring extra reasons to your attention.

贡献指南

打开贡献指南

调研方向

该 issue 没有指定文件、测试或依赖声明。首先定位 REST API 的实现及其 Joda-time 依赖,然后检查 AWS Lambda 如何加载受影响的类。只有在确定并验证了移除或隔离 Joda-time 的方案,且不会破坏与 Lambda 的兼容性后,才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, java
领域
api, cloud
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。