Created
July 9, 2017 20:29
-
-
Save muthugit/8769202b2c669eb3e853a24790fea740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment