Selecting a Runtime Interface Client

Your GraalVM function will run on a custom runtime. Which means your function will have to meet the requirements of the AWS Lambda Runtime API. Although you can write your own implementation of this API, a number of open source alternatives already exists. Including the open source AWS project aws-lambda-java-runtime-interface-client.

<dependency>
  <groupId>com.amazonaws</groupId>
  <artifactId>aws-lambda-java-runtime-interface-client</artifactId>
  <version>1.0.0</version>
</dependency>

This implementation is used in the managed Java runtimes and therefore is known to be battle hardened, having support for all the features and highly optimized for performance.

When deciding which implementation to use, make sure that the events you want to integrate with are supported. Most common are clients which can only handle String or Amazon API Gateway events.

To use the AWS RIC compile your naitive image with the main class set to com.amazonaws.services.lambda.runtime.api.client.AWSLambda. This class takes a single argument which is the fully qualified name of your handler and method name if required "example.App::sayHello"

An example bootstrap file:

#!/usr/bin/env bash

./my-naitive-binary "example.App::sayHello"