LambdaFunctionHandler.java implements the handleRequest method. This method is the entry point for the Lambda function, and it will be invoked by Lambda in response to input from the event sources of this function.
For this demonstration, we are doing a simple Hello World implementation, such as:
public class LambdaFunctionHandler implements RequestHandler<Object, String> {
@Override
public String handleRequest(Object input, Context context) {
String output = "Hello, " + input + "!";
return output;
}
}
You can run LambdaFunctionHandlerTest.java just as a normal JUnit test.
Using the Amazon Web Services -> Upload Function to AWS Lambda we can upload the function to AWS
Now we are ready to run the function in the cloud. Right-click on the project and select Amazon Web Services -> Run on AWS Lambda.
In the input dialog, enter the JSON input for this function.
Click Invoke and check the output of your function in the Eclipse Console View.