I am new to AWS lambda I have created a lambda function with handler
example.Orders::orderHandler
And this is the custom handler, now I wa
I followed the following code and just printed the response from the Lambda
AWSLambdaAsyncClient lambdaClient = new AWSLambdaAsyncClient();
lambdaClient.withRegion(Region.getRegion(Regions.US_WEST_2));
InvokeRequest invokeRequest = new InvokeRequest();
invokeRequest.setInvocationType("RequestResponse"); // ENUM RequestResponse or Event
invokeRequest.withFunctionName("FUNCTION NAME").withPayload(payload);
InvokeResult invoke = lambdaClient.invoke(invokeRequest);
try {
// PRINT THE RESPONSE
String val = new String(invoke.getPayload().array(), "UTF-8");
System.out.println("Response==> " + val);
} catch (Exception e) {
System.out.println("error");
}