2

We are using AWSLambdaAsync.invoke() to run Lambda in AWS. Do the connection stays up until the execute is finished?

Thanks in advance (-:

1 Answers1

3

It depends entirely on the parameters of the InvokeRequest object you are passing to the invoke() method. If you are passing an InvocationType of RequestResponse then the connection will stay open to the AWS API service until a response is returned from the Lambda function. If you are passing an InvocationType of Event then as soon as the Lambda function execution is started the AWS API service will return a success message and your connection will close.


Note that under the hood the AWS SDK for Java uses HTTP connection pooling, so in that sense the HTTP connection to the AWS API could actually stay open, but the request/response lifecycle of your Lambda invocation request will have completed.

Mark B
  • 183,023
  • 24
  • 297
  • 295