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

前端 未结 2 1334
不知归路
不知归路 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:43

    Given the information in your comment, your client code to invoke the function is fine. The problem appears to be with the configuration of the function itself. Specifically, AWS Lambda is not able to find the handler you've specified (com.aws.HelloLambda::handleRequest) because that doesn't match the name and package of your handler class (Hello) and the name of your method in that class (handleRequest).

    You can update the function handler name through the AWS Console. Choose your function, then the configuration tab and then the Handler property.

    You probably want to change it from com.aws.HelloLambda::handleRequest to Hello::handleRequest.

    Before testing the function from your Java client, you could test it directly through the console, this will help you ensure the function is configured correctly.

提交回复
热议问题