You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FAQs.md
+110-1
Original file line number
Diff line number
Diff line change
@@ -142,4 +142,113 @@ The following example shows how to use the Lambda Powertools Parameters module w
142
142
}
143
143
```
144
144
The `aws-crt-client` was considered for adoption as the default HTTP client in Lambda Powertools for Java as mentioned in [Move SDK http client to CRT](https://github.com/aws-powertools/powertools-lambda-java/issues/1092),
145
-
but due to the impact on the developer experience it was decided to stick with the `url-connection-client`.
145
+
but due to the impact on the developer experience it was decided to stick with the `url-connection-client`.
146
+
147
+
## How can I use Powertools for AWS Lambda (Java) with GraalVM?
148
+
149
+
Powertools core utilities, i.e. [logging](./core/logging.md), [metrics](./core/metrics.md) and [tracing](./core/tracing.md), include the [GraalVM Reachability Metadata (GRM)](https://www.graalvm.org/latest/reference-manual/native-image/metadata/) in the `META-INF` directories of the respective JARs. You can find a working example of Serverless Application Model (SAM) based application in the [examples](../examples/powertools-examples-core-utilities/sam-graalvm/README.md) directory.
150
+
151
+
These are typical steps you need to follow in a maven based Java project
152
+
153
+
### Set the environment to use GraalVM
154
+
155
+
```shell
156
+
export JAVA_HOME=<path to GraalVM>
157
+
```
158
+
159
+
### Use log4j > 2.24.0
160
+
Log4j version `2.24.0` adds [support for GraalVM](https://github.com/apache/logging-log4j2/issues/1539#issuecomment-2106766878). Depending on your project's dependency hierarchy, older version of log4j might be included in the final dependency graph. Make sure version `>2.24.0` of these dependencies are used by your maven project:
### Add the AWS Lambda Java Runtime Interface Client dependency
189
+
190
+
Runtime Interface Client allow your function to receive invocation events from Lambda, send the response back to Lambda, and report errors to the Lambda service. Add the below dependency to your maven project:
Also include the AWS Lambda GRM files by copying the `com.amazonaws`[directory](../examples/powertools-examples-core-utilities/sam-graalvm/src/main/resources/META-INF/native-image/) in your project's `META-INF/native-image` directory
201
+
202
+
### Build the native image
203
+
204
+
1. Use the `native-maven-plugin` to build the native image. You can do this by adding the plugin to your `pom.xml` and creating a build profile called `native-image` that can build the native image of your Lambda function:
2. Create a docker image using a Dockerfile like [this](../examples/powertools-examples-core-utilities/sam-graalvm/Dockerfile) to create an x86 based build image.
0 commit comments