Skip navigation links

Package com.amazonaws.mobileconnectors.lambdainvoker

This package provides features to invoke a Lambda function via dynamic proxy.

See: Description

Package com.amazonaws.mobileconnectors.lambdainvoker Description

This package provides features to invoke a Lambda function via dynamic proxy. One can define a standard Java method in an interface, and then get a proxied object by calling LambdaInvokerFactory.build.
 
 // define a method echo in MyEchoFunction
 public interface MyEchoFunction {
   // specify the Lambda function name and invocation type
    @LambdaFunction(functionName = "echo", invocationType = "RequestResponse")
   String echo(String str);
 }

 // creates an invocation factory
 LambdaInvokerFactory factory = new LambdaInvokerFactory(context,
     Regions.US_WEST_2, provider);

 // create a proxied object of MyEchoFunction
 MyEchoFunction echoFunction = factory.build(MyEchoFunction.class,
     new LambdaJsonBinder());

 // invoke it just like a regular method
 String echo = echoFunction.echo("Hello world!");
 
 
Skip navigation links

Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.