AWS Lambda : How to call lambda function from simple java class

前端 未结 2 1337
不知归路
不知归路 2021-02-05 19:07

I have created simple Lambda function and upload this to AWS Lambda.

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.r         


        
2条回答
  •  青春惊慌失措
    2021-02-05 19:22

    Another way to invoke lambda from java code is to use LambdaInvokerFactory and I found this approach cleaner. You need to do the following:

    1. Define interface representing your function and annotate method with @LambdaFunction

    2. Create implementation of the above interface using LambdaInvokerFactory

    3. Invoke lambda function using just created proxy object (interface implementation)

      More detailed example can be found here.

提交回复
热议问题